-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Cloud Health Dashboard Step 0: Set up Metrics Registry. #10478
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
Conversation
…cation and metrics, and metrics and description.
…c collection for test.
…sh is true or false.
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.
Looks good!
I want to call out the env var parsing. It feels like we are going backwards on our initiative to not access env vars from within the codebase. See comment below.
airbyte-metrics/lib/src/main/java/io/airbyte/metrics/lib/AirbyteApplication.java
Outdated
Show resolved
Hide resolved
* Enum containing all applications metrics are emitted for. Used to initialize | ||
* {@link DogStatsDMetricSingleton#initialize(AirbyteApplication, boolean)}. | ||
* | ||
* Application Name Conventions: |
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.
calling out the convention is great! thank you.
airbyte-metrics/lib/src/main/java/io/airbyte/metrics/lib/AirbyteMetricsRegistry.java
Show resolved
Hide resolved
airbyte-metrics/lib/src/main/java/io/airbyte/metrics/lib/AirbyteMetricsRegistry.java
Outdated
Show resolved
Hide resolved
airbyte-metrics/lib/src/main/java/io/airbyte/metrics/lib/AirbyteApplications.java
Outdated
Show resolved
Hide resolved
throw new RuntimeException("You cannot initialize configuration more than once."); | ||
} | ||
|
||
if (!publish) { |
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.
it's a little hard for me to understand the different configurations.
- line 43: if not publish then create the singleton but it won't publish anywhere
- line 49: create singleton specifying dd host and port
- line 55: ??? not sure.
it might be useful to have comments either in initialize
or javadocs comments for the constructor to understand what each of these configurations mean.
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.
you are right, I've added comments and doc strings. Does this make more sense?
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.
some of this is invalidated by the env var change. please take another look
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.
nice!
airbyte-metrics/lib/src/main/java/io/airbyte/metrics/lib/DogStatsDMetricSingleton.java
Outdated
Show resolved
Hide resolved
instancePublish = publish; | ||
statsDClient = new NonBlockingStatsDClientBuilder() | ||
.prefix(appName) | ||
.hostname(System.getenv("DD_AGENT_HOST")) // Matches Airbyte Cloud Datadog env vars. |
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.
why are we parsing env variables here? is there a reason we wouldn't pass this through EnvConfigs
like we do with other env variables? In october there was a big refactor to make sure we weren't paring env variables anywhere in the code base but centralize it all through EnvConfigs
and push it to the top of the application. I want to make sure we don't revert those efforts.
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.
good question. my initial thoughts were to place this in the constructor for convenience and also expose a flexible constructor to allow injecting (keeping our clean up in mind). I was also thinking of 'hiding' the variables for monitoring since they are cloud specific.
on second thought, no reason to keep this away from OSS users. we can put it in the env vars like you pointed out and document this for OSS folks with Datadog. How is that?
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.
made the changes - looks much cleaner now
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.
nice!
} | ||
|
||
/** | ||
* Submit a single execution time aggregated locally by the Agent. Use this if approximate stats are |
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.
as a developer reading this, it's not clear what we mean for approximate versus precise stats and when i should use which method. can you add more clarity, please?
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.
I've updated this. Is this clearer?
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.
better. i guess i'm still not clear on why i would ever use the non-precise one.
airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java
Outdated
Show resolved
Hide resolved
…odProcess.java Co-authored-by: Charles <[email protected]>
…ption. Simplify the constructor.
@cgardens I'm going to merge this in first to minimise any git management while I continue working on metrics. Please lmk if you disagree with anything - very happy to make changes. |
looks good to me. i had the one open question on when to use the two different time measurements but definitely not blocking |
I would use the histogram for the following reasons:
would it be helpful to add ^ to the docstring? |
yes! great. thank you. |
What
Set up a Metrics Registry. The purpose of this registry is to better enforce metrics -> application relationship, metric -> description relationship, provide a central location where folks can understand what metrics OSS AB emits, and enforce some standards.
Past experience has shown me that metrics emission can quickly get out of hand: 1) unclear what is emitted 2) similar metrics emitted in multiple places 3) not clear what metrics corresponds to what application.
This is my attempt to provide a framework for us to operate in.
Let me know if folks think this provides more complexity than is useful.
I've added the KubePodProcess metric in here to demonstrate/test how everything will work in practice.
How
Recommended reading order
AirbyteApplication.java
andAirbyteApplications.java
to understand how applications are tracked.AirbyteMetricRegistry.java
to understand how this fits in with everything.🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes