Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,15 @@ Update the `storage` configuration options based upon your requirements:

- [Google Cloud Storage configuration documentation](https://grafana.com/docs/tempo/<TEMPO_VERSION>/configuration/hosted-storage/gcs)

#### Azure with the `local_blocks` and metrics-generator processors

[//]: # "Shared content for local_blocks and metrics-generator in Azure blob storage when using Helm"
[//]: # "This content is located in /tempo/docs/sources/shared/azure-metrics-generator.md"

{{< docs/shared source="tempo" lookup="azure-metrics-generator.md" version="<TEMPO_VERSION>" >}}

For more information about the local-blocks processor, refer to [Configure TraceQL metrics](https://grafana.com/docs/tempo/next/metrics-from-traces/metrics-queries/configure-traceql-metrics).

### Set traces receivers

The Helm chart values in your `custom.yaml` file are configured to use OTLP.
Expand Down
3 changes: 2 additions & 1 deletion docs/sources/tempo/api_docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ GET /metrics

Returns the metrics for the running Tempo service in the Prometheus exposition format.


<!-- vale Grafana.Spelling = NO -->

### Pprof
Expand Down Expand Up @@ -153,7 +154,7 @@ Parameters:
Default = `00000000-0000-0000-0000-000000000000`
Example: `blockStart=12345678-0000-0000-1235-000001240000`
- `blockEnd = (GUID)`
Specifies the blockID finish boundary. If specified, the querier only searches blocks with IDs < blockEnd.
Specifies the blockID finish boundary. If specified, the querier only searches blocks with IDs < `blockEnd`.
Default = `FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF`
Example: `blockStart=FFFFFFFF-FFFF-FFFF-FFFF-456787652341`
- `start = (unix epoch seconds)`
Expand Down
117 changes: 63 additions & 54 deletions docs/sources/tempo/api_docs/pushing-spans-with-http.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Push spans with HTTP
description: Learn a basic technique for pushing spans with HTTP and JSON
aliases:
- /docs/tempo/latest/guides/pushing-spans-with-http/
- /docs/tempo/latest/guides/pushing-spans-with-http/
---

# Push spans with HTTP
Expand All @@ -23,67 +23,76 @@ Use the instructions in the [Quick start for Tempo documentation](https://grafan

## Push spans with OTLP

Now that Tempo is running and listening on port 4318 for [OTLP spans](https://opentelemetry.io/docs/specs/otlp/#otlphttp), let’s push a span to it using `curl`.
Now that Tempo is running and listening on port 4318 for [OTLP spans](https://opentelemetry.io/docs/specs/otlp/#otlphttp), you can push a span to Tempo using `curl`.

Before you can use this example, you need to update the start and end time as instructed.
{{< shared id="push-spans-http-otlp" >}}

```bash
curl -X POST -H 'Content-Type: application/json' http://localhost:4318/v1/traces -d '
{
"resourceSpans": [{
"resource": {
"attributes": [{
"key": "service.name",
"value": {
"stringValue": "my.service"
}
}]
},
"scopeSpans": [{
"scope": {
"name": "my.library",
"version": "1.0.0",
"attributes": [{
"key": "my.scope.attribute",
"value": {
"stringValue": "some scope attribute"
}
}]
},
"spans": [
{
"traceId": "5B8EFFF798038103D269B633813FC700",
"spanId": "EEE19B7EC3C1B100",
"name": "I am a span!",
"startTimeUnixNano": 1689969302000000000,
"endTimeUnixNano": 1689970000000000000,
"kind": 2,
"attributes": [
{
"key": "my.span.attr",
"value": {
"stringValue": "some value"
}
}]
}]
}]
}]
}'
```
Before you can use this example, you need to update the start and end time.

The `startTimeUnixNano` and `endTimeUnixNano` fields are in nanoseconds, where 100000000 nanoseconds is 100 milliseconds. The nanosecond value can be obtained by any tool that provides the epoch date in nanoseconds.
For example, under Linux, you can use `date +%s%N`.
You can also use an online tool such as [Epoch Converter](https://www.epochconverter.com/) to get the current time in nanoseconds.

Note that the `startTimeUnixNano` field is in nanoseconds and can be obtained by any tool that provides the epoch date in nanoseconds (for example, under Linux, `date +%s%N`). The `endTimeUnixNano` field is also in nanoseconds, where 100000000 nanoseconds is 100 milliseconds.
1. Copy and paste the `curl` command into a text editor.

1. Copy and paste the curl command into a text editor.
```bash
curl -X POST -H 'Content-Type: application/json' http://localhost:4318/v1/traces -d '
{
"resourceSpans": [{
"resource": {
"attributes": [{
"key": "service.name",
"value": {
"stringValue": "my.service"
}
}]
},
"scopeSpans": [{
"scope": {
"name": "my.library",
"version": "1.0.0",
"attributes": [{
"key": "my.scope.attribute",
"value": {
"stringValue": "some scope attribute"
}
}]
},
"spans": [
{
"traceId": "5B8EFFF798038103D269B633813FC700",
"spanId": "EEE19B7EC3C1B100",
"name": "I am a span!",
"startTimeUnixNano": 1689969302000000000,
"endTimeUnixNano": 1689970000000000000,
"kind": 2,
"attributes": [
{
"key": "my.span.attr",
"value": {
"stringValue": "some value"
}
}]
}]
}]
}]
}'
```

1. Replace `startTimeUnixNano` and `endTimeUnixNano` with current values for the last 24 hours to allow you to search for them using a 24 hour relative time range. You can get this in seconds and milliseconds from the following link.
Multiple the milliseconds value by 1,000,000 to turn it into nanoseconds. You can do this from a bash terminal with:
1. Replace `startTimeUnixNano` and `endTimeUnixNano` with current values for the last 24 hours to allow you to search for them using a 24 hour relative time range. You can get this in seconds and milliseconds from the [Unix Epoch Clock](https://www.epochconverter.com/).
For `startTimeUnixNano`, use the current time minus 24 hours. Use the link above to figure out the value.
For `endTimeUnixNano`, use the current time.

Multiply the milliseconds value by 1,000,000 to turn it into nanoseconds. You can do this from a bash terminal with the following command. Replace `<epochTimeMilliseconds>` with the milliseconds value.

```bash
echo $((<epochTimeMilliseconds> * 1000000))
```

1. Copy the updated curl command to a terminal window and run it.

{{< /shared >}}

1. View the trace in Grafana:
1. Open a browser window to http://localhost:3000.
1. Open the **Explorer** page and select the Tempo data source.
Expand All @@ -99,11 +108,11 @@ The easiest way to get the trace is to execute a simple curl command to Tempo. T

1. Replace the trace ID in the `curl` command with the trace ID that was generated from the push. This information is in the data that's sent with the `curl`. You could use Grafana’s Explorer page to find this, as shown in the previous section.

```bash
curl http://localhost:3200/api/v2/traces/5b8efff798038103d269b633813fc700
```bash
curl http://localhost:3200/api/v2/traces/5b8efff798038103d269b633813fc700

{"trace": {"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"my.service"}}]},"scopeSpans":[{"scope":{"name":"my.library","version":"1.0.0"},"spans":[{"traceId":"W47/95gDgQPSabYzgT/HAA==","spanId":"7uGbfsPBsQA=","name":"I am a span!","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1689969302000000000","endTimeUnixNano":"1689970000000000000","attributes":[{"key":"my.span.attr","value":{"stringValue":"some value"}}],"status":{}}]}]}]}}
```
{"trace": {"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"my.service"}}]},"scopeSpans":[{"scope":{"name":"my.library","version":"1.0.0"},"spans":[{"traceId":"W47/95gDgQPSabYzgT/HAA==","spanId":"7uGbfsPBsQA=","name":"I am a span!","kind":"SPAN_KIND_SERVER","startTimeUnixNano":"1689969302000000000","endTimeUnixNano":"1689970000000000000","attributes":[{"key":"my.span.attr","value":{"stringValue":"some value"}}],"status":{}}]}]}]}}
```

1. Copy and paste the updated `curl` command into a terminal window.

Expand Down
Loading