Skip to content

Comments

feat(headers): adding info headers#225

Merged
gamer496 merged 3 commits intomainfrom
feature/96371-custom-headers
May 6, 2025
Merged

feat(headers): adding info headers#225
gamer496 merged 3 commits intomainfrom
feature/96371-custom-headers

Conversation

@gamer496
Copy link
Contributor

adding custom info header to cli requests made through cognigy client.

example header:

'X-Cognigy-CLI-Info': 'cognigy-cli/1.6.4 project/6722201409dd9dee97022b13'

@gamer496 gamer496 self-assigned this Apr 30, 2025
@mhdha94
Copy link
Contributor

mhdha94 commented Apr 30, 2025

@gamer496 can we add the command as well to the data we gather? for example:
Cognigy-CLI/1.6.6 Project/abc123 Command/clone-agent

Becasue we want to geather info about which CLI commands are used

@gamer496
Copy link
Contributor Author

@gamer496 can we add the command as well to the data we gather? for example: Cognigy-CLI/1.6.6 Project/abc123 Command/clone-agent

Becasue we want to geather info about which CLI commands are used

wouldn't we get that from url path? In a much more granular way?

@mhdha94
Copy link
Contributor

mhdha94 commented Apr 30, 2025

@gamer496 can we add the command as well to the data we gather? for example: Cognigy-CLI/1.6.6 Project/abc123 Command/clone-agent
Becasue we want to geather info about which CLI commands are used

wouldn't we get that from url path? In a much more granular way?

@gamer496 We don't have a specific URL tied to each command, as each command can trigger multiple API calls, and some commands may share the same APIs. However, we can identify the command from the script arguments

@gamer496
Copy link
Contributor Author

gamer496 commented May 2, 2025

@gamer496 can we add the command as well to the data we gather? for example: Cognigy-CLI/1.6.6 Project/abc123 Command/clone-agent
Becasue we want to geather info about which CLI commands are used

wouldn't we get that from url path? In a much more granular way?

@gamer496 We don't have a specific URL tied to each command, as each command can trigger multiple API calls, and some commands may share the same APIs. However, we can identify the command from the script arguments

I understand your point. But every request will get registered as a separate metric. So clone command, for example, will trigger multiple api calls with clone header. We can discuss separately what the best way to register those commands is but I don't think it's headers.

@dcxn
Copy link
Collaborator

dcxn commented May 5, 2025

So Kei pointed me to your discussion here, I am again wondering if we need to add pendo as well on top. It would probably be nice to combine more granular custom events on pendo side with the access logs. We could additionally add a random Execution ID to each command run so that both pendo events and http request are trackable by that ID. Firebase did this and it was extremely helpful. Thoughts?

KeiKey
KeiKey previously approved these changes May 5, 2025
@gamer496
Copy link
Contributor Author

gamer496 commented May 6, 2025

So Kei pointed me to your discussion here, I am again wondering if we need to add pendo as well on top. It would probably be nice to combine more granular custom events on pendo side with the access logs. We could additionally add a random Execution ID to each command run so that both pendo events and http request are trackable by that ID. Firebase did this and it was extremely helpful. Thoughts?

I'm not very sure about pendo. We will take tracking commands as a separate task. For now I will merge this.

mhdha94
mhdha94 previously approved these changes May 6, 2025
// Ensure headers object exists and add the custom header
httpRequest.headers = {
...httpRequest.headers,
'X-Cognigy-CLI-Info': cliInfoHeader,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gamer496 why didn't you use User-Agent header?

...httpRequest.headers,
'X-Cognigy-Client-Info': cliInfoHeader,
};
console.log('httpRequest.headers', httpRequest.headers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gamer496 I think you forgot to remove this console.log

@gamer496 gamer496 requested a review from apdemin May 6, 2025 08:59
@gamer496 gamer496 merged commit 82621ee into main May 6, 2025
3 checks passed
@XavierJordaMurria
Copy link
Collaborator

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants