Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Add DiagnosticsTelemetryModule.AddOrSetHeartbeatProperty extension method#326

Merged
xavierdecoster merged 1 commit intomasterfrom
dev-heartbeats
Dec 19, 2019
Merged

Add DiagnosticsTelemetryModule.AddOrSetHeartbeatProperty extension method#326
xavierdecoster merged 1 commit intomasterfrom
dev-heartbeats

Conversation

@xavierdecoster
Copy link
Copy Markdown
Contributor

The AppInsights SDK only supports AddHeartbeatProperty or SetHeartbeatProperty, but no get.

The AddHeartbeatProperty method does not add when the payload already exists (it calls ConcurrentDictionary.GetOrAdd under the hood)

It's up to us to build logic about when to call which method above, so I wrapped it in a utility extension method so we can reuse this elsewhere (will use this e.g. in NuGet.Jobs.Common.JobRunner but potentially also in services/gallery), so it belongs in NuGet.Services.Logging (until AppInsights supports something like this out of the box).

Copy link
Copy Markdown
Contributor

@skofman1 skofman1 left a comment

Choose a reason for hiding this comment

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

:shipit:

@xavierdecoster xavierdecoster merged commit abbf45b into master Dec 19, 2019
@xavierdecoster xavierdecoster deleted the dev-heartbeats branch December 19, 2019 19:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants