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

[WIP] Add new IPC tags from IPC Metrics v2 spec #1155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

umairk79
Copy link

@umairk79 umairk79 commented Aug 29, 2024

Added new IPC tags as per the V2 spec:

  • ipc.source (To be used for api metrics)
  • ipc.method
  • ipc.source.code
  • ipc.attempt.reason

Open questions for discussion:

  • Should we create a new Enum for ApiMetric (Similar to IpcMetric)
  • Do we need validations for IpcAttemptReason and IpcMethod enums? The values present in the enum classes aren't supposed to be exhaustive hence I didn't put in a strict validation rule (As opposed to ipc.status which has a fixed set of allowed values)
  • Should we deprecate HttpMethod and HttpStatus from IpcTags

@@ -49,7 +49,9 @@ public enum IpcMetric {
IpcTagKey.status
),
EnumSet.of(
IpcTagKey.attemptReason,

Choose a reason for hiding this comment

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

Another idea here that we should get more feedback on is if we should :

  1. create a new set of IpcMetricV2 enums so we separate the existing tag sets from the new tag sets
  2. version this library and maintain the v1 separate from v2 (probably not enough here to warrant that)
  3. keep this as-is understanding that the optional tags from v1 and v2 are slightly different


public enum IpcMethod implements Tag {

/**

Choose a reason for hiding this comment

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

Now that I look at this class, I'd like to collect feedback on if we should keep these common sets of values here or if we should treat each implementation as their own sets maintained by the implementation itself.

@nicholashagen
Copy link

My thoughts on open questions:

Should we create a new Enum for ApiMetric (Similar to IpcMetric)

I would say yeah. I also raised the question in the code comments if we should have a IpcMetricV2 and then maybe ApiMetricV2 to align better and keep a cleaner definition of where the two align.

Do we need validations for IpcAttemptReason and IpcMethod enums? The values present in the enum classes aren't supposed to be exhaustive hence I didn't put in a strict validation rule (As opposed to ipc.status which has a fixed set of allowed values)

Good question. We need more understanding from others on how these are used. I like having concrete values provided to limit inconsistency, but also, is the non-exhaustive list more confusing to knowing it can be any string?

Should we deprecate HttpMethod and HttpStatus from IpcTags

This is tricky. If we don't end up versioning this library, then technically the aren't deprecated. I think if we go the route of IpcMetricV2 enum, then the enums would provide the set of tags and that would allow both to live side-by-side and the implementation can choose which version they want to align to (v1 or v2). At that point, there would be no need to deprecate.

@brharrington brharrington added this to the 1.7.20 milestone Aug 30, 2024
@brharrington
Copy link
Contributor

brharrington commented Sep 2, 2024

Should we create a new Enum for ApiMetric (Similar to IpcMetric)

Probably. I think we should try to provide as much clarity for use as possible.

Do we need validations for IpcAttemptReason and IpcMethod enums? The values present in the enum classes aren't supposed to be exhaustive hence I didn't put in a strict validation rule (As opposed to ipc.status which has a fixed set of allowed values)

I would argue that if it is worth standardizing, then we should strongly bias toward consistency and minimize any deviation. I'm not really sure I see the value of IpcMethod. For http there is already the specific version and it seems like the others are being shoe horned into that concept.

Should we deprecate HttpMethod and HttpStatus from IpcTags

To me the value of standardization is to be consistent and having different views of the IPC harms that goal. So if we are going to change them, then I would argue to try and get to a consistent place quickly and avoid long term issues with multiple versions. If that isn't possible, then it is probably better to not mess with the a new version of the existing IPC metrics and just do a minimal version of the api ipc metrics.

* The values for this are implementation specific. For example with HTTP,
* the status code value would be used here.
*/
statusCode("ipc.status.code"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why doesn't ipc.status.detail serve this purpose? I don't think we need yet another status dimension.


import com.netflix.spectator.api.Tag;

public enum IpcAttemptReason implements Tag {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to overlap in large part with the existing ipc.attempt.

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