Enhance telemetry configuration with dynamic properties and username#2339
Merged
Conversation
This allows passing information such as IDE version from the caller. Also, always add username info when telemetry backend is splunk. Splunk is used in controlled environments where privacy is less important but the ability to track usage per-user can be.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the telemetry client by improving default property handling and adding automatic user identification for Splunk backends. The changes centralize property management in buildDefaultConfiguration and ensure environment-provided client info is properly merged.
Key Changes:
- Added dynamic property merging with default system properties (OS, arch, hostname) and username for Splunk backends
- Modified
buildDefaultConfigurationto handle property merging from environment variables and backend-specific logic - Updated tests to verify username inclusion for Splunk backends and environment variable property merging
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/telemetry/tests/client.spec.ts | Added tests for username inclusion in Splunk backend and environment variable property merging; mocked os.userInfo() |
| packages/telemetry/src/types.ts | Added optional properties field to TelemetryConfiguration type |
| packages/telemetry/src/client.ts | Centralized property handling in buildDefaultConfiguration with backend-specific logic; removed inline property construction and flush() call |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Oct 27, 2025
hleb-rubanau
approved these changes
Oct 28, 2025
Contributor
|
🎉 This PR is included in version @appland/telemetry-v1.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the telemetry client by improving how default properties are set and merged, especially for different backend types. It ensures that environment-provided client info is included, and adds automatic user identification for Splunk backends. The tests have been updated to verify these behaviors.
Telemetry property handling improvements:
buildDefaultConfigurationfunction now merges default telemetry properties—including OS, architecture, hostname, and source—with any provided properties, and automatically adds the username for Splunk backends. It also merges client info from theAPPMAP_TELEMETRY_PROPERTIESenvironment variable.TelemetryConfigurationtype now includes an optionalpropertiesfield to support the new merged property handling.Testing and validation: