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

feat: Provide dependency names for dependencies & requests #229

Merged
merged 16 commits into from
Sep 27, 2021

Conversation

pim-simons
Copy link
Contributor

  • Requests are now logged with an operation name so they don't show in Application Insights as ''. For example:
    image
    After discussion with @stijnmoreels we decided to add 2 overloads to be able to specify a custom operataion name as well.
  • Names have been added to all dependancies so that they don't show up in Application Insights 'n/a'. For example:
    image

@netlify
Copy link

netlify bot commented Sep 2, 2021

✔️ Deploy Preview for arcus-observability canceled.

🔨 Explore the source changes: 4fb6cf0

🔍 Inspect the deploy log: https://app.netlify.com/sites/arcus-observability/deploys/614c94efd7e0a000071ad210

@stijnmoreels stijnmoreels changed the title Provide dependency names for all dependancies and operationname for requests feat: Provide dependency names for all dependancies and operationname for requests Sep 2, 2021
@stijnmoreels stijnmoreels linked an issue Sep 2, 2021 that may be closed by this pull request
Copy link
Contributor

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

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

If the PR is only for the request, can we remove the changes for the dependencies please?

@tomkerkhove
Copy link
Contributor

If you keep the dependency changes, can you please use the convention from https://github.com/arcus-azure/arcus-service-to-service-correlation-poc/blob/d1526c963c04b35243d71a65f9eefd3eeba1dcee/src/Arcus.POC.Observability.Telemetry.Serilog.Sinks.ApplicationInsights/Extensions/ILoggerExtensions.cs#L118 for Service Bus?

I didn't include the test but the goal is to align with the official SDK notation.

…ights/Converters/CloudContextConverter.cs

Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
@pim-simons
Copy link
Contributor Author

If you keep the dependency changes, can you please use the convention from https://github.com/arcus-azure/arcus-service-to-service-correlation-poc/blob/d1526c963c04b35243d71a65f9eefd3eeba1dcee/src/Arcus.POC.Observability.Telemetry.Serilog.Sinks.ApplicationInsights/Extensions/ILoggerExtensions.cs#L118 for Service Bus?

I didn't include the test but the goal is to align with the official SDK notation.

Thanks for the feedback!
Checked the code, the requested convention is $"{serviceBusNamespaceEndpoint} | {queueName}" but the Service Bus Namespace is currently not available on the Service Bus logging methods, only the type (Queue, Topic or Unknown) and name of the entity.
I could create new overloads for the Service Bus logging to include the namespace but then how do we set the dependencyName for the current methods without the namespace? Maybe we could do something like $"{entityType} | {entityName}" instead of just the entityName?
Let me know if I missed anything!

@stijnmoreels
Copy link
Member

stijnmoreels commented Sep 2, 2021

I'll have a look later, as I'm not allowed to work long for Arcus for more than a day in a week 😅, (shame).

Thanks for your PR! Very much appreciated! 🙏🥇
Great to have another enthusiastic contributor in our Arcus family.

@tomkerkhove tomkerkhove changed the title feat: Provide dependency names for all dependancies and operationname for requests feat: Provide dependency names for dependencies & requests Sep 3, 2021
@tomkerkhove
Copy link
Contributor

If you keep the dependency changes, can you please use the convention from arcus-azure/arcus-service-to-service-correlation-poc@d1526c9/src/Arcus.POC.Observability.Telemetry.Serilog.Sinks.ApplicationInsights/Extensions/ILoggerExtensions.cs#L118 for Service Bus?
I didn't include the test but the goal is to align with the official SDK notation.

Thanks for the feedback!
Checked the code, the requested convention is $"{serviceBusNamespaceEndpoint} | {queueName}" but the Service Bus Namespace is currently not available on the Service Bus logging methods, only the type (Queue, Topic or Unknown) and name of the entity.
I could create new overloads for the Service Bus logging to include the namespace but then how do we set the dependencyName for the current methods without the namespace? Maybe we could do something like $"{entityType} | {entityName}" instead of just the entityName?
Let me know if I missed anything!

We should have them indeed, but let's use a separate PR for that.

Copy link
Contributor

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

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

Looks like a good start, thank you!

I see two things we should do:

  • Provide unit tests for dependencies
  • Move the conversion to our OperationContextConverter

Copy link
Member

@stijnmoreels stijnmoreels left a comment

Choose a reason for hiding this comment

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

Great first step! You really have successfully found the necessary places to incorporate your requested changes. Like Tom said, we usually provide unit tests for every publicly available member (I'm sure you'll find the logging unit tests for requests).

  • Provide unit tests for requests (and dependencies if you don't create a separate PR for them)
  • Update the dependency integration tests to include the passed-along operation name

Let us know @pim-simons , if you need any help! You're doing a great job!

Copy link
Member

@stijnmoreels stijnmoreels left a comment

Choose a reason for hiding this comment

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

We're almost there! Let's have @tomkerkhove another look, especially on the casting/child classes. Otherwise, great job! 🥇

pim-simons and others added 2 commits September 9, 2021 07:37
…ationInsights/CustomDependencyTests.cs

Co-authored-by: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com>
…Tests.cs

Co-authored-by: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com>
pim-simons and others added 2 commits September 9, 2021 07:43
…Tests.cs

Co-authored-by: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com>
Copy link
Member

@stijnmoreels stijnmoreels left a comment

Choose a reason for hiding this comment

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

I'll approve on my part. Great stuff!

@stijnmoreels stijnmoreels removed their assignment Sep 21, 2021
…Name, changed the CreateTelemetryEntry method for the requests to add the requestMethod to the operationName if it is missing
Copy link
Contributor

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

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

LGTM, thank you! 🎉

@tomkerkhove
Copy link
Contributor

I think we are good to go, except for the integration tests - Are these on your radar?

@pim-simons
Copy link
Contributor Author

I think we are good to go, except for the integration tests - Are these on your radar?

I updated the integration tests to check for the dependencyname and added some integration tests for the requestlogging to test specifying a custom operation name.
Am I missing any?

@tomkerkhove
Copy link
Contributor

They seem to be failing, can you please have a look?

@pim-simons
Copy link
Contributor Author

They seem to be failing, can you please have a look?

Worst argument ever, but works on my machine 😉
image

I can't really find a reason why these specific tests would fail, is there any way to manually restart them?

@tomkerkhove
Copy link
Contributor

/azp run CI - Arcus.Observability

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pim-simons
Copy link
Contributor Author

It's all looking green now 👍🏻 seems like the tests worked this time

@tomkerkhove
Copy link
Contributor

🙌 Thank you for the nice contribution!

@tomkerkhove tomkerkhove merged commit 7de37b4 into arcus-azure:master Sep 27, 2021
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.

Provide dependency name for all dependencies
3 participants