-
Notifications
You must be signed in to change notification settings - Fork 28
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
when mapping inventory-metric ID to hawkular-metric ID, check if metrid-id property exists #110
Comments
AFAIK the API doesn't do/use any inventory data to query a metric endpoint. It's left to the developer to decide how to mix inventory/metric data. We could add this warning to the Readme or we could add the attribute |
@josejulio Yeah, I think the latter is what @jmazzitelli meant. We always populate a field with metric-id or fall back to id. |
If is not mandatory for the developer to know the real id of the inventory_metric we could manually implement the attr :id (as getId doesn't seem very ruby-ish) to return the metric_id (if available) so this change would be even more transparent. |
I just commented the following in hwkagent-78, but I will post here too: Heiko asked "why not directly set the id of the metric definition in inventory to the metric-id here?" The reason is due to the implementation and how the MeasurementInstance objects are immutable. When the measurement instance IDs are generated, it happens as we build up the Resource using a builder API - this is when we create these instances with our own internal IDs. Once we build the resource, then we pass that instance to our sampling service impl to generate a metric ID and attach it to the measurement instance. It does not have to work this way. I think we can change the implementation to do something like make the ID mutable and change it - or somehow get the builder to create the ID on the fly somehow. It was just easier implementing it the way it is now. But if this extra "metric-id" property is causing problems and we do not want to have it, we can try to fix it and make it go away. |
Did this ever get fixed? I don't see a related PR documented here. |
Not yet, I've plans on doing it. But haven't setup my env to have a domain eap (and then i'll have to setup a custom metric_id template). |
There is a use-case to give users some freedom and flexibility to choose what their hawkular-metric IDs look like, rather than force them to adopt the rule "inventory metric ID is always the same as hawkular metric ID".
The hawkular wildfly agent is introducing an optional "metric-id" property found on the inventory metric instance definition. When this property exists, the hawkular-metric ID is the value of that property (it is not the value of that inventory metric instance ID).
The current behavior will remain the same and will become the default - inventory metric instance ID is the same as the hawkular-metric ID - they will only be different if someone adds that "metric-id" property in inventory.
See the HWKAGENT JIRA issue and associated PR where the agent creates this metric-id when appropriate: https://issues.jboss.org/browse/HWKAGENT-78
The text was updated successfully, but these errors were encountered: