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

STORY-25143 - Add prometheus metrics to smokescreen #1

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

jmcconnell26
Copy link

No description provided.

README.md Outdated
@@ -59,6 +59,10 @@ Here are the options you can give Smokescreen:
--deny-address value Add IP[:PORT] to list of blocked IPs. Repeatable.
--allow-address value Add IP[:PORT] to list of allowed IPs. Repeatable.
--egress-acl-file FILE Validate egress traffic against FILE
--prometheus-endpoint ENDPOINT Expose Prometheus metrics on the given endpoint.

Choose a reason for hiding this comment

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

Is the default endpoint /metrics?

Copy link
Author

Choose a reason for hiding this comment

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

I had gone for requiring this to be set to enable prometheus, so not having any default value.
I'd been on the fence with having an --expose-prometheus flag which doesn't take a value, and then keep --prometheus-endpoint with a default value of /metrics which may be cleaner?

Copy link

@armandocerna armandocerna left a comment

Choose a reason for hiding this comment

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

great work! a few minor things

* Don't export metrics list
* Follow project sytlistic choices
README.md Outdated
@@ -59,6 +59,10 @@ Here are the options you can give Smokescreen:
--deny-address value Add IP[:PORT] to list of blocked IPs. Repeatable.
--allow-address value Add IP[:PORT] to list of allowed IPs. Repeatable.
--egress-acl-file FILE Validate egress traffic against FILE
--prometheus-endpoint ENDPOINT Expose Prometheus metrics on the given endpoint.

Choose a reason for hiding this comment

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

does ENDPOINT default to /metrics? I'm a bit confused by some of the wording here.

Copy link
Author

Choose a reason for hiding this comment

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

@alex-kalinowski: #1 (comment) <- I'm happy to add a --enable-prometheus flag, and have the --prometheus-endpoint default to /metrics - it's probably the cleanest way to structure the config.

cli.StringFlag{
Name: "prometheus-endpoint",
Usage: "Expose metrics via prometheus on `ENDPOINT`.",
},

Choose a reason for hiding this comment

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

Maybe this is just how my brain works with cli args but can we default this to /metrics and add an additional flag to the effect of metric-type where you would choose statsd and/or prometheus and then ride the defaults if needed?

As of now the default is always shipping statsd metrics. Might want to provide a toggle to flip those off.

Copy link
Author

Choose a reason for hiding this comment

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

@alex-kalinowski, I've pushed a change to add the --expose-prometheus-metrics flag to toggle exposing prometheus metrics.

Currently the default isn't shipping statsd metrics? A default flag is set for statsd-address, but unless the flag is explicitly passed in, IsSet("statsd-address") will return false, and the SetupStatsd() method won't be called.

Choose a reason for hiding this comment

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

I assumed IsSet() returned true for defaults as well.

@jmcconnell26 jmcconnell26 marked this pull request as ready for review October 3, 2022 15: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.

3 participants