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

Emit warning if APPINSIGHTS_INSTRUMENTATIONKEY isn't set, but Distributed Tracing is enabled #1787

Merged
merged 9 commits into from
May 25, 2021

Conversation

bachuv
Copy link
Collaborator

@bachuv bachuv commented Apr 8, 2021

Currently, if a customer enables distributed tracing in the app's host.json, but doesn't set APPINSIGHTS_INSTRUMENTATIONKEY as an environment variable then startup will fail saying that APPINSIGHTS_INSTRUMENTATIONKEY isn't set.

This PR allows startup to succeed if Distributed Tracing is enabled, but APPINSIGHTS_INSTRUMENTATIONKEY isn't set. If APPINSIGHTS_INSTRUMENTATIONKEY isn't set then the extension will emit this warning: 'APPINSIGHTS_INSTRUMENTATIONKEY' isn't defined in the current environment variables, but Distributed Tracing is enabled. Please set 'APPINSIGHTS_INSTRUMENTATIONKEY' to use Distributed Tracing..

Resolves #1694

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation PR is ready to merge and referenced in pending_docs.md
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@bachuv bachuv added this to the v2.5.0 milestone Apr 8, 2021
@bachuv bachuv self-assigned this Apr 8, 2021
@bachuv bachuv removed this from In progress in Distributed Tracing Improvements Apr 29, 2021
Copy link
Contributor

@ConnorMcMahon ConnorMcMahon left a comment

Choose a reason for hiding this comment

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

A couple of small changes, but otherwise looks good!

Copy link
Contributor

@ConnorMcMahon ConnorMcMahon left a comment

Choose a reason for hiding this comment

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

LGTM!

@bachuv bachuv merged commit 9eb88fb into dev May 25, 2021
@bachuv bachuv deleted the vabachu/instrumentationkey branch May 25, 2021 00:59
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.

Distrubted tracing fails on local debug if instrumentation key not set
3 participants