Skip to content

Commit d46c1a2

Browse files
authored
Merge pull request #92 from autometrics-dev/specify_label_context
Specify where each label is used
2 parents 6a161e4 + 040210f commit d46c1a2

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

specs/autometrics_v1.0.0.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,12 @@ function.
184184

185185
## Labels
186186

187-
The following is a list of labels and their intended use. See the
188-
[metrics](#metrics) section for which labels are valid on each metric.
187+
The following is a list of labels and their intended use.
189188

190189
### `autometrics.version`
191190

191+
> Used with metrics: [`build_info`](#build_info)
192+
192193
The version of the specification that the library targets. This version MUST
193194
contain the full version without the `v` prefix.
194195

@@ -199,11 +200,15 @@ For the current specification this SHOULD be `1.0.0`.
199200

200201
### `branch`
201202

203+
> Used with metrics: [`build_info`](#build_info)
204+
202205
The Git branch of the user's project. If this information is not available, this
203206
label MAY be absent or empty (`""`).
204207

205208
### `caller.function`
206209

210+
> Used with metrics: [`function.calls`](#functioncalls)
211+
207212
The name of the `function` that invoked the given function. If the caller is
208213
not known, this label MUST be absent or empty (`""`).
209214

@@ -216,23 +221,31 @@ information has a non-negligible performance overhead.
216221

217222
### `caller.module`
218223

224+
> Used with metrics: [`function.calls`](#functioncalls)
225+
219226
The `module` of the function that invoked the given function. If the caller is
220227
not known, this label MUST be absent or empty (`""`).
221228

222229
See [`caller.function`](#callerfunction)
223230

224231
### `commit`
225232

233+
> Used with metrics: [`build_info`](#build_info)
234+
226235
The Git commit hash identifying the snapshot of the user's project. The library
227236
MAY truncate the commit hash to its short representation. If this information is
228237
not available, this label MUST be absent or empty (`""`).
229238

230239
### `function`
231240

241+
> Used with metrics: [`function.calls`](#functioncalls), [`function.calls.duration`](#functioncallsduration), [`function.calls.concurrent`](#functioncallsconcurrent)
242+
232243
The name of the function or method, exactly as it appears in the source code.
233244

234245
### `module`
235246

247+
> Used with metrics: [`function.calls`](#functioncalls), [`function.calls.duration`](#functioncallsduration), [`function.calls.concurrent`](#functioncallsconcurrent)
248+
236249
The fully-qualified module or file path of the `function`.
237250

238251
The combination of the `function` and `module` labels MUST be sufficient to
@@ -242,6 +255,8 @@ The exact contents of this label value are assumed to be language-specific.
242255

243256
### `objective.name`
244257

258+
> Used with metrics: [`function.calls`](#functioncalls), [`function.calls.duration`](#functioncallsduration)
259+
245260
If a function has an [SLO](#service-level-objectives-slos) attached, this label
246261
MUST contain the user-specified name of the objective. If there is no SLO
247262
attached, this label MUST be absent or empty (`""`).
@@ -252,6 +267,8 @@ The library SHOULD warn users when an objective name does not start with an alph
252267

253268
### `objective.percentile`
254269

270+
> Used with metrics: [`function.calls`](#functioncalls), [`function.calls.duration`](#functioncallsduration)
271+
255272
If a function has an [SLO](#service-level-objectives-slos) attached, this label
256273
MUST specifies the percentage of requests that should return the `result="ok"`
257274
OR the percentage of requests that should meet the specified
@@ -269,6 +286,8 @@ rules for the custom percentiles.
269286

270287
### `objective.latency_threshold`
271288

289+
> Used with metrics: [`function.calls.duration`](#functioncallsduration)
290+
272291
If a function has an [SLO](#service-level-objectives-slos) attached, this MUST
273292
specify the maximum duration of function calls that are considered meeting
274293
the objective.
@@ -284,6 +303,8 @@ metric.
284303

285304
### `result`
286305

306+
> Used with metrics: [`function.calls`](#functioncalls)
307+
287308
Whether the function executed successfully or errored. An error MAY either mean
288309
that the function returned an error or that it threw an exception.
289310

@@ -295,6 +316,8 @@ example to allow users to treat client-side errors as `"ok"`.
295316

296317
### `service.name`
297318

319+
> Used with metrics: [`build_info`](#build_info), [`function.calls`](#functioncalls), [`function.calls.duration`](#functioncallsduration), [`function.calls.concurrent`](#functioncallsconcurrent)
320+
298321
The logical name of a service. This matches the
299322
[OpenTelemetry Service specification](https://github.com/open-telemetry/semantic-conventions/tree/main/specification/resource/semantic_conventions#service).
300323

@@ -311,12 +334,16 @@ something like a package name or the binary name.
311334

312335
### `version`
313336

337+
> Used with metrics: [`build_info`](#build_info)
338+
314339
The version of the user's project, ideally using
315340
[Semantic Versioning](https://semver.org/). It SHOULD only contain the version
316341
number and SHOULD NOT start with a `v`.
317342

318343
### `repository.url`
319344

345+
> Used with metrics: [`build_info`](#build_info)
346+
320347
A URL to the user's project git or other scm repository. This SHOULD be a URL
321348
that makes sense for the repository type. For example, for a git repository, it
322349
MAY be a HTTP URL or a SSH URL.
@@ -328,6 +355,8 @@ by itself, but the user MUST be able to opt-out of this behavior.
328355

329356
### `repository.provider`
330357

358+
> Used with metrics: [`build_info`](#build_info)
359+
331360
A hint to which provider is being used to host the repository. A consumer can
332361
use this to provider deeper integration. The value MUST be a freeform string to
333362
allow users to specify their own values.

0 commit comments

Comments
 (0)