-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Extracting vmId form Azure instance metadata #27692
Extracting vmId form Azure instance metadata #27692
Conversation
…containerId/nodeId) easily
Fixes #27689 |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Outdated
Show resolved
Hide resolved
...re-cosmos/src/main/java/com/azure/cosmos/implementation/clienttelemetry/ClientTelemetry.java
Outdated
Show resolved
Hide resolved
...osmos/src/main/java/com/azure/cosmos/implementation/clienttelemetry/ClientTelemetryInfo.java
Show resolved
Hide resolved
...mos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DiagnosticsClientContext.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I am still confused between machineId and vmId . Can't we choose a consistent name or is that intentional to keep them separate?
...osmos/src/main/java/com/azure/cosmos/implementation/clienttelemetry/ClientTelemetryInfo.java
Outdated
Show resolved
Hide resolved
...osmos/src/main/java/com/azure/cosmos/implementation/clienttelemetry/ClientTelemetryInfo.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/ClientTelemetryTest.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Show resolved
Hide resolved
...re-cosmos/src/main/java/com/azure/cosmos/implementation/clienttelemetry/ClientTelemetry.java
Show resolved
Hide resolved
...osmos/src/main/java/com/azure/cosmos/implementation/clienttelemetry/ClientTelemetryInfo.java
Outdated
Show resolved
Hide resolved
eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml
Outdated
Show resolved
Hide resolved
...re-cosmos/src/main/java/com/azure/cosmos/implementation/clienttelemetry/ClientTelemetry.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
A sample Request diagnostics and client telemetry payload after this change would be really helpful. |
Description
Extracts the vmId from Azure instance metadata and put the vmId (or a static UUID for the lifetime of the process) as static machine identifier into the request diagnostics and client telemetry. I have used a static uuid instead of trying to get the machine name (and hash it for PII reasons) because there is no reliable way to get the host name in java (it either maps to OS specific implementations or is using network calls with revers-DNS lookup). All we need is a stable identifer - stable even across multiple cosmos client instances if customers don't use singleton pattern - that we can also use to distinguish client machines. The vmId is ideal because with Client Telemetry it would allow us to get further telemetry - like OS metrics etc. if the customer's app is hosted on Azure(and instance metadata is available). When vmId isn't availbel a stable identifier is the min-bar.
NOTE: I also fixed a typo in the package name for client telemetry - this is internal API - so shouldn't be breaking
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines