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

[activemq58] Proper prefix on service check #53

Closed
wants to merge 1 commit into from

Conversation

elafarge
Copy link
Contributor

I hacked the StatsDReporter to send the status of activemq.can_connect
instead of activemq_58.can_connect. Hope it was the right place to do
so.

@elafarge elafarge force-pushed the etienne/activemq-58-sc-hack branch from 7217b70 to 7218b33 Compare April 22, 2015 18:51
@remh remh assigned yannmh and unassigned remh May 12, 2015
@@ -28,7 +28,7 @@ protected void sendMetricPoint(String metricName, double value, String[] tags) {
this.statsDClient.stop();
init();
}
statsDClient.gauge(metricName, value, tags);
statsDClient.gauge(StatsdReporter.formatDataName(metricName), value, tags);
Copy link
Member

Choose a reason for hiding this comment

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

metricName should be alias names defined in user configurations. I don't think we want/need to format it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I know that. The problem is that the service check name isn't defined in user configurations :/

My point here was just to enable us to stop getting the service check prefix from the configuration file and therefore being able to have versioned configuration file without getting versioned prefixes in our backend (activemq.yaml, activemq_58.yaml, activemq_62.yaml...). In the first place I just did a dirty if(checkName == 'activemq_58') checkName = 'activemq'; do you think this would be more suitable ? Or maybe we could format the metricName when it's read from the yaml file name instead of doing it every time the metrics'service checks are sent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or actually make it so the service check name is also read from the configuration, just like the metrics are... what do you think ?

@yannmh
Copy link
Member

yannmh commented May 12, 2015

Great work, thanks @elafarge.

I wrote a few suggestions. Please let me know what you think about it.

@elafarge elafarge force-pushed the etienne/activemq-58-sc-hack branch from 9dc8500 to 23f1ec9 Compare May 13, 2015 15:47
I hacked the StatsDReporter to send the status of activemq.can_connect
instead of activemq_58.can_connect.

It's a bit better than a simple Hack. We decided that the prefix name
shouldn't contain any number, underscore or capital letter (should we
add the dash to this list ?). This way we can have version dependant
configuration in the .yaml config files for JMXFetch without having
multiple and dirty metrics and service check names in the HQ.

UNIT TEST SUITE UPDATE
----------------------

Added a simple unit test to the prefix formatter, when adding versionned
integration like activemq_58, it would be good to check that its prefix
is correctly formatted here.
@elafarge elafarge force-pushed the etienne/activemq-58-sc-hack branch from 23f1ec9 to 789083f Compare May 13, 2015 16:10
@elafarge
Copy link
Contributor Author

Thanks :) I just finished implementing your suggestions. It looks better now :)

@elafarge
Copy link
Contributor Author

Moved there #56, closing the PR.

@elafarge elafarge closed this May 13, 2015
@elafarge elafarge deleted the etienne/activemq-58-sc-hack branch May 13, 2015 22:48
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