Skip to content

Updating Missing Telemetry#48978

Open
mrm9084 wants to merge 8 commits intoAzure:mainfrom
mrm9084:TelemetryTracingUpdate
Open

Updating Missing Telemetry#48978
mrm9084 wants to merge 8 commits intoAzure:mainfrom
mrm9084:TelemetryTracingUpdate

Conversation

@mrm9084
Copy link
Copy Markdown
Member

@mrm9084 mrm9084 commented Apr 29, 2026

Description

Updates the library with the latest tracing info for supported features. Note: as of this PR Snapshot References isn't supported.

Copilot AI review requested due to automatic review settings April 29, 2026 18:44
@github-actions github-actions Bot added the azure-spring All azure-spring related issues label Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Spring Cloud Azure App Configuration’s correlation-context/tracing telemetry to include additional supported feature signals (e.g., load balancing, AI profiles, feature flag metadata) and wires TracingInfo through replica clients so request policies can emit the updated telemetry.

Changes:

  • Extend correlation-context generation to emit new key/value pairs and tags (Features, FFFeatures, MaxVariants, Failover, FMSpVer, etc.).
  • Add/expand feature-flag tracing to capture seed/telemetry usage and max variant count.
  • Propagate TracingInfo through replica client construction and update unit tests accordingly.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/TracingInfo.java Adds new feature flags/tags to correlation-context and new setters for load balancing/AI/failover.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/FeatureFlagTracing.java Tracks additional feature-flag telemetry (seed, telemetry enabled, max variants).
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/RequestTracingConstants.java Adds new correlation-context key/tag constants.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/FeatureFlagClient.java Parses feature-flag JSON to populate new tracing fields.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLoader.java Marks requests as failover when switching replicas.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClientsBuilder.java Ensures TracingInfo is shared into replica clients; marks load balancing usage.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClient.java Stores and exposes TracingInfo for per-client telemetry.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationConstants.java Adds constants for AI mime profiles and feature abbreviations.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySource.java Updates tracing based on settings’ content-type.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/TracingInfoTest.java Adds tests for new correlation-context fields/tags.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/http/policy/FeatureFlagTracingTest.java Adds tests for new feature-flag tracing behaviors.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClientTest.java Updates test construction to include TracingInfo.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationPropertySourceKeyVaultTest.java Stubs getTracingInfo() for updated call sites.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationApplicationSettingPropertySourceTest.java Stubs getTracingInfo() for updated call sites.

if (!hostType.isEmpty()) {
sb.append(",").append(RequestTracingConstants.HOST_TYPE_KEY).append("=").append(hostType);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we have dev environment tracking?

Copy link
Copy Markdown
Member Author

@mrm9084 mrm9084 May 4, 2026

Choose a reason for hiding this comment

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

I don't remember the reasoning, but I was told to remove it a while back. Our new providers don't have it and it was more of a guess there is no true convention like in .net.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

/**
* Resets AI configuration tracing flags.
*/
public void resetAiConfigurationTracing() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When do we reset this telemetry?

* Sets whether telemetry is used.
* @param usesTelemetry whether telemetry is used
*/
public void setUsesTelemetry(Boolean usesTelemetry) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is all feature tracing being reset after each server call? This applies to any telemetry that is tracked on the key-value (or ff) level. App-level telemetry like "uses load balancing" or "uses key vault" doesn't change, so it doesn't need to be reset. But kv-level telemetry can change based on the value in AppConfig

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is FeatureManagement telemetry, not store wide.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, so this needs to be reset based on what feature flags are loaded by the application.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is reset via resetFeatureFilterTelemetry which if you follow the code path resets every time we load/refresh. Actually now that I think about it this might actually be a bug. To de-dup everything all stores use the same FeatureFlagClient object, and they all use that one tracing. If a customer uses multiple stores we will be 1 reporting everything to the wrong store, And then reset before we can send to this store.

I'll create an issue to track this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Actually this might not be an issue. Here is how it works. we have a class called AzureAppConfigDataLoader this method is called once per store we are loading keys/feature flags from. One of the first things it does is reset this telemetry.

We then send the feature flag telemetry if and only if refresh is enabled. As we don't make any requests after this otherwise.

We use to load feature flags first to solve this, but that broke when we added support for Snapshots if I remember correctly as snapshots have negative priority order for feature flags.

Comment on lines +63 to +65
public void setUsesSnapshotReference(boolean usesSnapshotReference) {
this.usesSnapshotReference = usesSnapshotReference;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where is this set?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TLDR, I wrote the snapshot reference support, then realized none of this existed. So the answer is nowhere/in a PR I've yet to publish. I can remove it and just add it back in that PR.

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

Labels

azure-spring All azure-spring related issues

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants