Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track telemetry on api requests #3355

Merged
merged 13 commits into from
Feb 12, 2024
Merged

track telemetry on api requests #3355

merged 13 commits into from
Feb 12, 2024

Conversation

esmadau
Copy link
Contributor

@esmadau esmadau commented Feb 8, 2024

Description

Start tracking additional telemetry api requests:
min, max and total bytes and instance count.

Example of how it shows up in telemetry:
image

Related issues

Addresses [AB#105723].

Testing

Describe how this change was tested.

@esmadau esmadau requested a review from a team as a code owner February 8, 2024 00:29
foreach ((string key, string value) in properties)
{
if (requestTelemetry.Properties.ContainsKey(key))
requestTelemetry.Properties["DuplicateDimension"] = bool.TrueString;
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this DuplicateDimension? Are you expecting any of the dimension to be already present?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - it's not guaranteed that we'd get a single one so we have to carefully filter out and not try to add duplicates. We're guaranteed at least one, but could have duplicates. We follow the same pattern elsewhere

public void Initialize(ITelemetry telemetry)
{
if (telemetry is RequestTelemetry requestTelemetry)
AddPropertiesFromHttpContextItems(requestTelemetry);
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this step gets executed for all the health check requests too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - I don't see any reason to treat healthchecks differently, it can cause confusion when we go do our queries. Do you foresee issues with treating all requests the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

That is just some extra unwanted processing, since health check happens every 15-30 seconds. You can keep it if you need these columns to be populated in RequestTelemetry for health checks.

public void Initialize(ITelemetry telemetry)
{
if (telemetry is RequestTelemetry requestTelemetry)
AddPropertiesFromHttpContextItems(requestTelemetry);
Copy link
Contributor

Choose a reason for hiding this comment

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

That is just some extra unwanted processing, since health check happens every 15-30 seconds. You can keep it if you need these columns to be populated in RequestTelemetry for health checks.

@esmadau esmadau enabled auto-merge (squash) February 12, 2024 17:33
@esmadau esmadau merged commit 90ea691 into main Feb 12, 2024
17 checks passed
@esmadau esmadau deleted the users/esmadau/apireqtelem branch February 12, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants