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

Add ability to send metrics via sentry-cli #2001

Closed
AbhiPrasad opened this issue Mar 26, 2024 · 4 comments · Fixed by #2063
Closed

Add ability to send metrics via sentry-cli #2001

AbhiPrasad opened this issue Mar 26, 2024 · 4 comments · Fixed by #2063
Assignees

Comments

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Mar 26, 2024

Using sentry-cli is a nice way to send metrics in bash scripts and similar.

We already have support for sending events, so this seems like a nice fit.

Ideal API:

sentry-cli send-metric gauge -n cpu_usage -v 34 -t os:MacOS -u percent

send-metric: Command to send metric. Requires argument of increment, distribution, set, or gauge (matches with our sdk public API).

Options:
-n: Name of metric (required)
-v: Metric value (required)
-u: unit (optional)
-t: tag (optional, can provide multiple)

maybe we can also somehow capture code location?

--

Since these needs have evolved over the last couple of weeks, please also make sure to implement:

The most recent state of current Metrics features can be found in [this doc], please check it once you plan to start the implementation of this issue, to see if there is anything else that needs to be implemented. (https://docs.google.com/spreadsheets/d/14cjYBAWI6RkDilqXYAsLYa89wIWdQJq350fjwqT1uyI/edit#gid=0)

@szokeasaurusrex
Copy link
Member

@jan-auer Is metrics rate limiting going to be relevant for the CLI, given that each send-metrics call will originate from a separate CLI call with the proposed API? If so, I think we will need to implement this change by somehow saving the backoff information in a temp file

@elramen elramen self-assigned this Apr 15, 2024
@elramen
Copy link
Contributor

elramen commented Apr 15, 2024

After discussing with @szokeasaurusrex, code location will not be implemented (at least not for the initial iteration).

elramen added a commit that referenced this issue Apr 29, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
Copy link

github-actions bot commented May 7, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

elramen added a commit that referenced this issue May 14, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 14, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 14, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 14, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 15, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 15, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 15, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 15, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 15, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 16, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 16, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 16, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 21, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 21, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 21, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 27, 2024
Add CLI command that can emit metrics.

Fixes GH-2001
elramen added a commit that referenced this issue May 27, 2024
Add CLI command send-metric for emitting metrics to Sentry.
Add new command-parser that uses clap's Derive API. Future commands should use this as the Derive API makes it:
-Easier to read, write, and modify arguments and commands.
-Easier to keep the argument declaration and reading of argument in sync.
-Easier to reuse shared arguments.

Fixes GH-2001
@AbhiPrasad
Copy link
Member Author

Nice work @elramen! Looking forward to this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants