-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
117 additions
and
20 deletions.
There are no files selected for viewing
32 changes: 19 additions & 13 deletions
32
semantic-conventions/src/tests/data/jinja/metrics/expected.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
package io.opentelemetry.instrumentation.api.metric; | ||
|
||
class Units { | ||
class Metrics { | ||
|
||
/** | ||
* Use this unit for Metric Instruments recording values | ||
* representing fraction of a total. | ||
**/ | ||
public static final String PERCENT = "%"; | ||
* Measures the duration of inbound HTTP requests | ||
* | ||
* Instrument: histogram | ||
* Unit: s | ||
*/ | ||
public static final String HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration"; | ||
|
||
/** | ||
* Use this unit for Metric Instruments recording values | ||
* representing time. | ||
**/ | ||
public static final String NANOSECOND = "NS"; | ||
* Measures the number of concurrent HTTP requests that are currently in-flight | ||
* | ||
* Instrument: updowncounter | ||
* Unit: {request} | ||
*/ | ||
public static final String HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests"; | ||
|
||
/** | ||
* Use this unit for Metric Instruments recording values | ||
* representing connections. | ||
**/ | ||
public static final String CONNECTIONS = "{connections}"; | ||
* Measures the size of HTTP request messages | ||
* | ||
* Instrument: histogram | ||
* Unit: By | ||
*/ | ||
public static final String HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size"; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
semantic-conventions/src/tests/data/jinja/metrics/metrics_template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.opentelemetry.instrumentation.api.metric; | ||
|
||
class Metrics { | ||
{% for id in semconvs %}{%- if semconvs[id].GROUP_TYPE_NAME == 'metric' %}{% set metric = semconvs[id] %} | ||
/** | ||
* {{metric.brief | to_doc_brief}} | ||
* | ||
* Instrument: {{metric.instrument }} | ||
* Unit: {{metric.unit }} | ||
*/ | ||
public static final String {{metric.metric_name | to_const_name}} = "{{metric.metric_name}}"; | ||
{# Extra line #} | ||
{%- endif %}{% endfor %} | ||
} |
23 changes: 23 additions & 0 deletions
23
semantic-conventions/src/tests/data/jinja/units/expected.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.opentelemetry.instrumentation.api.metric; | ||
|
||
class Units { | ||
|
||
/** | ||
* Use this unit for Metric Instruments recording values | ||
* representing fraction of a total. | ||
**/ | ||
public static final String PERCENT = "%"; | ||
|
||
/** | ||
* Use this unit for Metric Instruments recording values | ||
* representing time. | ||
**/ | ||
public static final String NANOSECOND = "NS"; | ||
|
||
/** | ||
* Use this unit for Metric Instruments recording values | ||
* representing connections. | ||
**/ | ||
public static final String CONNECTIONS = "{connections}"; | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
semantic-conventions/src/tests/data/yaml/metrics/metrics.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
groups: | ||
- id: metric_attributes.http.server | ||
type: attribute_group | ||
brief: "server attributes." | ||
attributes: | ||
- id: http.request.method | ||
type: string | ||
brief: "The HTTP request method." | ||
examples: 'GET' | ||
- id: http.response.status_code | ||
type: string | ||
brief: "The HTTP response status code." | ||
examples: '200' | ||
|
||
- id: metric.http.server.request.duration | ||
type: metric | ||
metric_name: http.server.request.duration | ||
brief: "Measures the duration of inbound HTTP requests." | ||
instrument: histogram | ||
unit: "s" | ||
extends: metric_attributes.http.server | ||
|
||
- id: metric.http.server.active_requests | ||
type: metric | ||
metric_name: http.server.active_requests | ||
brief: "Measures the number of concurrent HTTP requests that are currently in-flight." | ||
instrument: updowncounter | ||
unit: "{request}" | ||
attributes: | ||
- ref: http.request.method | ||
|
||
- id: metric.http.server.request.body.size | ||
type: metric | ||
metric_name: http.server.request.body.size | ||
brief: "Measures the size of HTTP request messages." | ||
instrument: histogram | ||
unit: "By" | ||
extends: metric_attributes.http.server |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters