Skip to content

Commit

Permalink
docs(releasing): Fix docs for new components in v0.41.0 (#21260)
Browse files Browse the repository at this point in the history
* Add documentation for static_metrics source

Signed-off-by: Jesse Szwedko <[email protected]>

* Document `greptimedb_logs` sink

And fix `greptimedb_metrics` aliasing.

Also fixed incorrect batch documentation that I noticed.

Signed-off-by: Jesse Szwedko <[email protected]>

---------

Signed-off-by: Jesse Szwedko <[email protected]>
  • Loading branch information
jszwedko committed Sep 10, 2024
1 parent 70fc515 commit 584c70c
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: GreptimeDB
description: Writes metric data to [GreptimeDB](https://github.com/greptimeteam/greptimedb)
title: GreptimeDB Metrics
description: Writes metrics to [GreptimeDB](https://github.com/greptimeteam/greptimedb)
component_kind: sink
layout: component
tags: ["greptimedb", "component", "sink", "storage", "time-series", "metrics"]
aliases: ["/docs/reference/configuration/sinks/greptimedb"]
---

{{/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Static metrics
description: Publish statically configured metrics on an interval
component_kind: source
layout: component
tags: ["vector", "instance", "local", "internal", "component", "source", "metrics"]
---

{{/*
This doc is generated using:

1. The template in layouts/docs/component.html
2. The relevant CUE data in cue/reference/components/...
*/}}
20 changes: 20 additions & 0 deletions website/cue/reference.cue
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ _values: {
"string"?: #TypeString & {_args: required: Args.required}
"ascii_char"?: #TypeAsciiChar & {_args: required: Args.required}
"timestamp"?: #TypeTimestamp & {_args: required: Args.required}
"int"?: #TypeInt & {_args: required: Args.required}
"uint"?: #TypeUint & {_args: required: Args.required}
}

Expand Down Expand Up @@ -618,6 +619,25 @@ _values: {
examples: [_values.current_timestamp]
}

#TypeInt: {
_args: required: bool
let Args = _args

if !Args.required {
// `default` sets the default value.
default: int | *null
}

// `examples` clarify values through examples. This should be used
// when examples cannot be derived from the `default` or `enum`
// options.
examples?: [int, ...int]

// `unit` clarifies the value's unit. While this should be included
// as the suffix in the name, this helps to explicitly clarify that.
unit?: #Unit | null
}

#TypeUint: {
_args: required: bool
let Args = _args
Expand Down
12 changes: 6 additions & 6 deletions website/cue/reference/components.cue
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ components: {
}
}
type: "counter"
default_namespace: "vector"
default_namespace: string | *"vector"
}

_passthrough_distribution: {
Expand All @@ -1212,7 +1212,7 @@ components: {
}
}
type: "distribution"
default_namespace: "vector"
default_namespace: string | *"vector"
}

_passthrough_gauge: {
Expand All @@ -1225,7 +1225,7 @@ components: {
}
}
type: "gauge"
default_namespace: "vector"
default_namespace: string | *"vector"
}

_passthrough_histogram: {
Expand All @@ -1238,7 +1238,7 @@ components: {
}
}
type: "gauge"
default_namespace: "vector"
default_namespace: string | *"vector"
}

_passthrough_set: {
Expand All @@ -1251,7 +1251,7 @@ components: {
}
}
type: "gauge"
default_namespace: "vector"
default_namespace: string | *"vector"
}

_passthrough_summary: {
Expand All @@ -1264,7 +1264,7 @@ components: {
}
}
type: "gauge"
default_namespace: "vector"
default_namespace: string | *"vector"
}
}
}
Expand Down
19 changes: 13 additions & 6 deletions website/cue/reference/components/sinks/greptimedb_logs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ components: sinks: greptimedb_logs: {
batch: {
enabled: true
common: false
max_bytes: 10_000_000
max_events: 20
timeout_secs: 1.0
}
compression: enabled: false
Expand All @@ -45,7 +45,7 @@ components: sinks: greptimedb_logs: {
interface: {
socket: {
api: {
title: "GreptimeDB HTTP API"
title: "GreptimeDB gRPC API"
url: urls.greptimedb_docs
}
direction: "outgoing"
Expand All @@ -66,17 +66,24 @@ components: sinks: greptimedb_logs: {
configuration: base.components.sinks.greptimedb_logs.configuration

input: {
logs: true
metrics: null
traces: false
logs: true
metrics: {
counter: false
distribution: false
gauge: false
histogram: false
set: false
summary: false
}
traces: false
}

how_it_works: {
setup: {
title: "Setup"
body: """
1. Start your own [GreptimeDB](\(urls.greptimedb)) or create an instance on [GreptimeCloud](\(urls.greptimecloud)).
2. Configure HTTP endpoint(host:port), optional dbname, authentication information, and pipeline info.
2. Configure gRPC endpoint(host:port) and optional dbname and authentication information.
"""
}
}
Expand Down
7 changes: 4 additions & 3 deletions website/cue/reference/components/sinks/greptimedb_metrics.cue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package metadata

components: sinks: greptimedb: {
title: "GreptimeDB"
components: sinks: greptimedb_metrics: {
title: "GreptimeDB Metrics"
alias: "greptimedb"

classes: {
commonly_used: true
Expand All @@ -20,7 +21,7 @@ components: sinks: greptimedb: {
batch: {
enabled: true
common: false
max_bytes: 10_000_000
max_events: 20
timeout_secs: 1.0
}
compression: enabled: false
Expand Down
84 changes: 84 additions & 0 deletions website/cue/reference/components/sources/static_metrics.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package metadata

components: sources: static_metrics: {
title: "Static Metrics"

description: """
Publish statically configured metrics on an interval. This can be useful for publishing
heartbeats or sending the value of an environment variable as a metric.
"""

classes: {
commonly_used: true
delivery: "at_least_once"
deployment_roles: ["aggregator", "daemon", "sidecar"]
development: "stable"
egress_method: "batch"
stateful: false
}

features: {
acknowledgements: false
collect: {
checkpoint: enabled: false
from: service: services.vector
}
multiline: enabled: false
}

support: {
notices: []
requirements: []
warnings: []
}

installation: {
platform_name: null
}

configuration: base.components.sources.static_metrics.configuration

output: metrics: {
counter: output._passthrough_counter & {
default_namespace: "static"
}
distribution: output._passthrough_distribution & {
default_namespace: "static"
}
gauge: output._passthrough_gauge & {
default_namespace: "static"
}
set: output._passthrough_set & {
default_namespace: "static"
}
}

examples: [
{
title: "Emit a heartbeat"
configuration: {
metrics: [
{
name: "heartbeat"
kind: "absolute"
value:
gauge: 1
tags:
env: "${ENV}"
},
]
}
input: ""
output: metric: {
name: "heartbeat"
kind: "absolute"
namespace: "static"
timestamp: "2024-09-10T19:04:58Z"
gauge:
value: 1.0
tags:
env: "${ENV}"
}
},
]
}

0 comments on commit 584c70c

Please sign in to comment.