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

Adds option to disable Stackdriver Export #293

Merged
merged 14 commits into from
Feb 20, 2020

Conversation

askmeegs
Copy link
Contributor

@askmeegs askmeegs commented Feb 15, 2020

Adds environment variable option to disable Stackdriver export for Metrics and Tracing, along with the option to turn off Stackdriver Profiler and Debugger.

All services still default to True for exporting to SD - must manually add the env variables to disable export.

Example deployment YAML:

        env:
        - name: PORT
          value: "7000"
        - name: DEBUGGER
          value: "False"
        - name: TRACE
          value: "False"
        - name: PROFILER
          value: "False"
shippingservice-d6567fcb7-9dg9z server {"message":"Debugger disabled.","severity":"info","timestamp":"2020-02-15T22:11:30.628788162Z"}
shippingservice-d6567fcb7-9dg9z server {"message":"Tracing disabled.","severity":"info","timestamp":"2020-02-15T22:11:30.628900674Z"}
shippingservice-d6567fcb7-9dg9z server {"message":"Stats disabled.","severity":"info","timestamp":"2020-02-15T22:11:30.629103694Z"}
shippingservice-d6567fcb7-9dg9z server {"message":"Shipping Service listening on port :50051","severity":"info","timestamp":"2020-02-15T22:11:30.629151017Z"}

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 15, 2020
@askmeegs askmeegs changed the title [WIP] Adds option to disable OpenCensus Stats, Metrics, Tracing [WIP] Adds option to disable Stackdriver Export Feb 15, 2020
@askmeegs askmeegs changed the title [WIP] Adds option to disable Stackdriver Export Adds option to disable Stackdriver Export Feb 16, 2020
Copy link
Member

@daniel-sanche daniel-sanche left a comment

Choose a reason for hiding this comment

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

LGTM. I deployed to a fresh cluster and had no issues

@ahmetb
Copy link
Contributor

ahmetb commented Feb 19, 2020

I think my main feedback would be: Do not parse booleans.
YAML especially is notoriously bad for storing booleans.

Instead of doing TRACE="False", consider checking for existence of a flag, for example DISABLE_TRACE, and any value that's set (even 0) would just disable it.

@ahmetb
Copy link
Contributor

ahmetb commented Feb 19, 2020

^ This alone would simplify a lot of the current code.

src/shippingservice/main.go Outdated Show resolved Hide resolved
@askmeegs
Copy link
Contributor Author

askmeegs commented Feb 20, 2020

@ahmetb does this look ok to merge?

@ahmetb
Copy link
Contributor

ahmetb commented Feb 20, 2020

Couple nits, otherwise looking good.

@askmeegs askmeegs merged commit 90f9287 into GoogleCloudPlatform:master Feb 20, 2020
@askmeegs askmeegs deleted the opencensus-option branch February 20, 2020 20:26
clenimar pushed a commit to clenimar/microservices-demo that referenced this pull request Mar 28, 2020
D-Mwanth pushed a commit to D-Mwanth/microservices-demo that referenced this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants