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

feat: stop sending metrics when CLI command is executed on CI/CD pipeline #10

Merged

Conversation

peter-rr
Copy link
Collaborator

Description
Stop sending metrics when process.env.NODE_ENV === 'CI', which means that a CLI command is executed on CI/CD pipeline.

@peter-rr peter-rr requested a review from smoya January 26, 2024 11:51
@@ -80,7 +80,8 @@ export default abstract class extends Command {

recorderFromEnv(prefix: string): Recorder {
let sink: Sink = new DiscardSink();
if (process.env.ASYNCAPI_METRICS !== 'false') {

if (process.env.ASYNCAPI_METRICS !== 'false' && process.env.CI !== 'true') {
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't be this an OR rather than an AND?

Suggested change
if (process.env.ASYNCAPI_METRICS !== 'false' && process.env.CI !== 'true') {
if (process.env.ASYNCAPI_METRICS !== 'false' || process.env.CI !== 'true') {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure about it 🤔
What if ASYNCAPI_METRICS = 'true' and CI = 'true'? In that situation we would be sending metrics when applying the OR condition. So if that scenario is possible, shouldn't we apply the AND condition instead?

Copy link
Owner

Choose a reason for hiding this comment

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

You are right 👍

@smoya smoya merged commit 33759d2 into smoya:feat/adoptionMetrics Jan 30, 2024
5 of 8 checks passed
@peter-rr peter-rr deleted the feat/adoptMetrics-stop-metrics-ci branch January 30, 2024 12:49
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.

2 participants