Skip to content

Commit

Permalink
GCS error handling, example, and documentation (#397)
Browse files Browse the repository at this point in the history
* Address silent errors in tenants/blocks iterators and other places in gcs backend. Add gcs example using fake-gcs-server and add necessary settings. Add documentation page for GCS configuration. Update gcs client library reference for header parsing bug fix

* Vendor check

* Close writer on error

* Remove bucket creation and related projectid setting from gcs backend

* Apply suggestions from code review

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update changelog

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
  • Loading branch information
mdisibio and achatterjee-grafana committed Dec 8, 2020
1 parent 435e3d1 commit 40abd5d
Show file tree
Hide file tree
Showing 162 changed files with 17,248 additions and 11,202 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* [CHANGE] Redo tempo-cli with basic command structure and improvements [#385](https://github.com/grafana/tempo/pull/385)
* [CHANGE] Add content negotiation support and sharding parameters to Querier [#375](https://github.com/grafana/tempo/pull/375)
* [ENHANCEMENT] Add docker-compose example for GCS along with new backend options [#397](https://github.com/grafana/tempo/pull/397)
* [BUGFIX] Compactor without GCS permissions fail silently [#379](https://github.com/grafana/tempo/issues/379)

## v0.4.0

Expand Down
1 change: 1 addition & 0 deletions docs/tempo/website/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ compactor:
The storage block is used to configure TempoDB. It supports S3, GCS, local file system, and optionally can use Memcached or Redis for increased query performance.

The following example shows common options. For platform-specific options refer to the following:
* [GCS](gcs/)
* [S3](s3/)
* [Redis](redis/)

Expand Down
18 changes: 18 additions & 0 deletions docs/tempo/website/configuration/gcs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Google Cloud Storage (GCS)
---

# Google Cloud Storage (GCS) configuration
GCS backend is configured in the storage block. Tempo requires a dedicated bucket since it maintains a top-level object structure and does not support a custom prefix to nest within a shared bucket.

```
storage:
trace:
backend: gcs # store traces in gcs
s3:
bucket_name: tempo # store traces in this bucket
chunk_buffer_size: 10485760 # optional. buffer size for reads. default = 10MiB
endpoint: https://storage.googleapis.com/storage/v1/ # optional. api endpoint override
insecure: false # optional. Set to true to disable authentication
# and certificate checks.
```
66 changes: 66 additions & 0 deletions example/docker-compose/docker-compose.gcs.fake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: "2"
services:

tempo:
image: grafana/tempo:latest
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./etc/tempo-gcs-fake.yaml:/etc/tempo.yaml
- ./example-data/tempo:/tmp/tempo
ports:
- "14268" # jaeger
- "3100:3100" # tempo
depends_on:
- gcs

gcs:
image: fsouza/fake-gcs-server
command: -public-host gcs:4443
ports:
- "4443:4443"
volumes:
# This creates an empty tempo bucket
- ./example-data/gcs/tempo/:/data/tempo/

tempo-query:
image: grafana/tempo-query:latest
command: ["--grpc-storage-plugin.configuration-file=/etc/tempo-query.yaml"]
volumes:
- ./etc/tempo-query.yaml:/etc/tempo-query.yaml
depends_on:
- tempo
ports:
- "16686:16686" # jaeger-ui

synthetic-load-generator:
image: omnition/synthetic-load-generator:1.0.25
volumes:
- ./etc/load-generator.json:/etc/load-generator.json
environment:
- TOPOLOGY_FILE=/etc/load-generator.json
- JAEGER_COLLECTOR_URL=http://tempo:14268
depends_on:
- tempo

prometheus:
image: prom/prometheus:latest
volumes:
- ./etc/prometheus.yaml:/etc/prometheus.yaml
entrypoint:
- /bin/prometheus
- --config.file=/etc/prometheus.yaml
ports:
- "9090:9090"

grafana:
image: grafana/grafana:7.3.0-beta1
volumes:
- ./example-data/datasources:/etc/grafana/provisioning/datasources
- ./example-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards
- ../../operations/tempo-mixin/out:/var/lib/grafana/dashboards
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- "3000:3000"
47 changes: 47 additions & 0 deletions example/docker-compose/etc/tempo-gcs-fake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
auth_enabled: false

server:
http_listen_port: 3100

distributor:
receivers: # this configuration will listen on all ports and protocols that tempo is capable of.
jaeger: # the receives all come from the OpenTelemetry collector. more configuration information can
protocols: # be found there: https://github.com/open-telemetry/opentelemetry-collector/tree/master/receiver
thrift_http: #
grpc: # for a production deployment you should only enable the receivers you need!
thrift_binary:
thrift_compact:
zipkin:
otlp:
protocols:
http:
grpc:
opencensus:

ingester:
trace_idle_period: 10s # the length of time after a trace has not received spans to consider it complete and flush it
traces_per_block: 100 # cut the head block when it his this number of traces or ...
max_block_duration: 5m # this much time passes

compactor:
compaction:
compaction_window: 1h # blocks in this time window will be compacted together
max_compaction_objects: 1000000 # maximum size of compacted blocks
block_retention: 1h
compacted_block_retention: 10m
flush_size_bytes: 5242880

storage:
trace:
backend: gcs # backend configuration to use
wal:
path: /tmp/tempo/wal # where to store the the wal locally
bloom_filter_false_positive: .05 # bloom filter false positive rate. lower values create larger filters but fewer false positives
index_downsample: 10 # number of traces per index record
gcs:
bucket_name: tempo
endpoint: https://gcs:4443/storage/v1/
insecure: true
pool:
max_workers: 100 # the worker pool mainly drives querying, but is also used for polling the blocklist
queue_depth: 10000
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/grafana/tempo
go 1.15

require (
cloud.google.com/go/storage v1.6.0
cloud.google.com/go/storage v1.12.0
contrib.go.opencensus.io/exporter/prometheus v0.2.0
github.com/alecthomas/kong v0.2.11
github.com/alicebob/miniredis v2.5.0+incompatible
Expand Down Expand Up @@ -40,16 +40,15 @@ require (
github.com/weaveworks/common v0.0.0-20201029142910-313edde7a455
github.com/willf/bitset v1.1.10 // indirect
github.com/willf/bloom v2.0.3+incompatible
go.opencensus.io v0.22.3
go.opencensus.io v0.22.4
go.opentelemetry.io/collector v0.6.1
go.uber.org/atomic v1.6.0
go.uber.org/goleak v1.1.10
go.uber.org/zap v1.15.0
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
google.golang.org/api v0.29.0
google.golang.org/api v0.32.0
google.golang.org/genproto v0.0.0-20201028140639-c77dae4b0522 // indirect
google.golang.org/grpc v1.33.1
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/yaml.v2 v2.3.0
)

Expand Down

0 comments on commit 40abd5d

Please sign in to comment.