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

Agent Breakdown Metrics #78

Closed
felixbarny opened this issue Apr 22, 2019 · 10 comments
Closed

Agent Breakdown Metrics #78

felixbarny opened this issue Apr 22, 2019 · 10 comments

Comments

@felixbarny
Copy link
Member

felixbarny commented Apr 22, 2019

Description of the issue

To facilitate breakdown graphs (#70), agents should track metrics for the self-time of spans grouped by their span.type, as well as the duration for the transactions.

Example documents:

{
  "metricset": {
    "timestamp": 1555603735414000,
    "transaction": {
      "name": "test transaction",
      "type": "request"
    },
    "span": {
      "type": "db",
      "subtype": "mysql"
    },
    "samples": {
      "span.self_time.count": { "value": 100 },
      "span.self_time.sum.us":   { "value": 100000 }
    }
  }
}
{
  "metricset": {
    "timestamp": 1555603735414000,
    "transaction": {
      "name": "test transaction",
      "type": "request"
    },
    "span": {
      "type": "app"
    },
    "samples": {
      "span.self_time.count": { "value": 10 },
      "span.self_time.sum.us":   { "value": 200000 }
    }
  }
}
{
  "metricset": {
    "timestamp": 1555603735414000,
    "transaction": {
      "name": "test transaction",
      "type": "request"
    },
    "samples": {
      "transaction.duration.count":  { "value": 10 },
      "transaction.duration.sum.us":    { "value": 300000 },
      "transaction.breakdown.count": { "value": 10 },
    }
  }
}

For more details, background and explanation, see this concept: https://docs.google.com/document/d/1-_LuC9zhmva0VvLgtI0KcHuLzNztPHbcM0ZdlcPUl64

What we are voting on

Tick your box if the concept looks good to you in general and if you think we can proceed. The details can be adjusted along the way. I'll create implementation issues if we agree to proceed with this concept.

Vote

Agent Yes No Indifferent N/A Link to agent issue
.NET
elastic/apm-agent-dotnet#227
Go
elastic/apm-agent-go#528
Java
elastic/apm-agent-java#556
Node.js
elastic/apm-agent-nodejs#1064
Python
elastic/apm-agent-python#479
Ruby
elastic/apm-agent-ruby#420
RUM
elastic/apm-agent-rum-js#289
@felixbarny felixbarny added this to the 7.2 milestone Apr 22, 2019
@felixbarny felixbarny mentioned this issue Apr 22, 2019
7 tasks
@roncohen
Copy link

roncohen commented Apr 23, 2019

Look like we have good alignment with regard to the existing documents we create. However, this seems new? ;)

"span": {
  "type": "transaction"
 },

@felixbarny
Copy link
Member Author

felixbarny commented Apr 23, 2019

@jalvz
Copy link
Contributor

jalvz commented Jun 20, 2019

Dear @elastic/apm-agent-devs ,
Since server needs to provide explicit support for this (eg for UI to do aggregations based on some of these fields), and we target 7.3, and we don't want breaking/complicated changes after that; I'd much appreciate if you get on ticking boxes and/or amending the proposal.

Truly yours,

Juan

@felixbarny
Copy link
Member Author

There's actually one change we may need to do which is to change transaction.duration.sum to transaction.duration.sum.us and span.self_time.sum to span.self_time.sum.us. That also means reporting in µs instead of ms.

@axw As I'll be on vacation for the next two weeks, could you help to make sure we get to a decision on that?

@felixbarny
Copy link
Member Author

@elastic/apm-agent-devs PSA: I have updated the description to reflect the proposed changes ^

@jalvz
Copy link
Contributor

jalvz commented Jun 24, 2019

will these fields be required?

@axw
Copy link
Member

axw commented Jul 1, 2019

@jalvz which fields? The server can't require any of them, as that'll break older agents.

We could do some kind of conditional requirement. These are the expectations:

  • span.self_time.count and span.self_time.sum.us are either both present, or both missing
  • likewise for transaction.duration.count, transaction.duration.sum.us

transaction.breakdown.count is currently only present along with those last two fields, but I don't know if we should enforce that at the schema level. We might later want to relax things, e.g. we could optimise storage slightly by assuming transaction.breakdown.count == transaction.duration.count if the former is not specified.

For all of these metrics, transaction.name and transaction.type must be present. For the span.self_time metrics, span.type must also be present, and span.subtype may be present.

@simitt
Copy link
Contributor

simitt commented Jul 8, 2019

@felixbarny just raised concerns about the newly added properties on the Intake API for metricsets https://github.com/elastic/apm-server/blob/1ac64d62933d62d965efb98e38c088fee9ae4d8f/docs/spec/metricsets/metricset.json#L23...L88.
The properties are actually sent up within the already existing property spec, e.g.

{
  "metricset": {
    "timestamp": 1555603735414000,
    "transaction": {
      "name": "test transaction",
      "type": "request"
    },
    "span": {
      "type": "db",
      "subtype": "mysql"
    },
    "samples": {
      "span.self_time.count": { "value": 100 },
      "span.self_time.sum.us":   { "value": 100000 }
    }
  }
}

Therefore the added properties will not be used.

Referring to #78 (comment) we need to decide if we should remove the currently unused properties from the Intake API again and not do any required/conditionally required validation on metrics, or change the definition and add the requirements to the Intake API. At the moment, no requirement validations are implemented for those fields.

I suggest to not apply those validations and thus remove the additional fields on the Intake API, as applying validations for the next version would technically be a breaking change.

@felixbarny
Copy link
Member Author

felixbarny commented Jul 8, 2019

I suggest to not apply those validations and thus remove the additional fields on the Intake API

++

simitt added a commit to simitt/apm-server that referenced this issue Jul 8, 2019
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct and unnecessary as already covered
by the more generic pattern.
simitt added a commit to simitt/apm-server that referenced this issue Jul 8, 2019
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct as they miss the `value` part and
therefore unnecessary as already covered by the existing, more generic pattern.
@axw
Copy link
Member

axw commented Jul 9, 2019

Removing the properties/having no validation sounds fine to me.

simitt added a commit to elastic/apm-server that referenced this issue Jul 9, 2019
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct as they miss the `value` part and
therefore unnecessary as already covered by the existing, more generic pattern.
simitt added a commit to simitt/apm-server that referenced this issue Jul 9, 2019
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct as they miss the `value` part and
therefore unnecessary as already covered by the existing, more generic pattern.
simitt added a commit to simitt/apm-server that referenced this issue Jul 9, 2019
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct as they miss the `value` part and
therefore unnecessary as already covered by the existing, more generic pattern.
simitt added a commit to elastic/apm-server that referenced this issue Jul 9, 2019
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct as they miss the `value` part and
therefore unnecessary as already covered by the existing, more generic pattern.
simitt added a commit to elastic/apm-server that referenced this issue Jul 9, 2019
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct as they miss the `value` part and
therefore unnecessary as already covered by the existing, more generic pattern.
bmorelli25 pushed a commit to bmorelli25/observability-docs that referenced this issue Dec 18, 2023
As discussed in
elastic/apm#78 (comment) the
additional properties are not correct as they miss the `value` part and
therefore unnecessary as already covered by the existing, more generic pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants