Skip to content

Commit 91fed94

Browse files
committed
Proper upgrade
1 parent cfa4124 commit 91fed94

File tree

4 files changed

+206
-13
lines changed

4 files changed

+206
-13
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ RUN wget https://github.com/lomik/go-carbon/releases/download/v0.12.0-rc1/go-car
2626

2727
# install grafana
2828
ADD conf/etc/grafana/grafana.ini /etc/grafana/grafana.ini
29+
ADD conf/etc/grafana/provisioning/datasources/carbonapi.yaml /etc/grafana/provisioning/datasources/carbonapi.yaml
2930
RUN wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.0.0_amd64.deb \
3031
&& dpkg -i grafana_5.0.0_amd64.deb \
3132
&& rm /grafana_5.0.0_amd64.deb \
3233
&& service grafana-server restart \
3334
&& sleep 5 \
34-
&& curl -X POST -H 'Content-Type: application/json' -u 'admin:admin' \
35-
-d '{ "name": "carbonapi", "type": "graphite", "url": "http://127.0.0.1:8081", "access": "proxy", "basicAuth": false }' \
36-
"http://127.0.0.1:3000/api/datasources" \
3735
&& service grafana-server stop \
3836
&& mkdir -p /usr/share/grafana/data \
3937
&& mv -fv /var/lib/grafana/* /usr/share/grafana/data

conf/etc/carbonapi/carbonapi.yaml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# Need to be URL, http or https
2-
# This url specifies the backend or a loadbalancer
3-
#
4-
# Is you are using carbonzipper you should set it to
5-
# zipper's url
6-
#
7-
# If you are using plain go-carbon or graphite-clickhouse
8-
# you should set it to URL of go-carbon's carbonserver module
9-
# or graphite-clickhouse's http url.
10-
zipper: "http://localhost:8080"
111
# Listen address, should always include hostname or ip address and a port.
122
listen: "localhost:8081"
133
# Max concurrent requests to CarbonZipper
@@ -54,6 +44,47 @@ graphite:
5444
# Maximium idle connections to carbonzipper
5545
idleConnections: 10
5646
pidFile: ""
47+
upstreams:
48+
# Number of 100ms buckets to track request distribution in. Used to build
49+
# 'carbon.zipper.hostname.requests_in_0ms_to_100ms' metric and friends.
50+
# Requests beyond the last bucket are logged as slow
51+
# (default of 10 implies "slow" is >1 second).
52+
buckets: 10
53+
timeouts:
54+
# Maximum total backend requesting timeout in ms.
55+
# ( How long we may spend making requests. )
56+
global: "15s"
57+
# Timeout, in ms, once the final backend has been contacted.
58+
# ( [Effectively] How long we'll wait for the slowest response. )
59+
afterStarted: "10s"
60+
# Timeout to connect to the server
61+
connect: "200ms"
62+
# Number of concurrent requests to any given backend - default is no limit.
63+
# If set, you likely want >= MaxIdleConnsPerHost
64+
concurrencyLimit: 0
65+
# Configures how often keep alive packets will be sent out
66+
keepAliveInterval: "30s"
67+
# Control http.MaxIdleConnsPerHost. Large values can lead to more idle
68+
# connections on the backend servers which may bump into limits; tune with care.
69+
maxIdleConnsPerHost: 100
70+
# "http://host:port" array of instances of carbonserver stores
71+
# This is the *ONLY* config element in this section that MUST be specified.
72+
# loclhost:8080 - go-carbon
73+
backends:
74+
- "http://localhost:8080"
75+
carbonsearch:
76+
# Instance of carbonsearch backend
77+
backend: "http://127.0.0.1:8070"
78+
# carbonsearch prefix to reserve/register
79+
prefix: "virt.v1.*"
80+
# Enable compatibility with graphite-web 0.9
81+
# This will affect graphite-web 1.0+ with multiple cluster_servers
82+
# Default: disabled
83+
graphite09compat: false
84+
# If not zero, enabled cache for find requests
85+
# This parameter controls when it will expire (in seconds)
86+
# Default: 600 (10 minutes)
87+
expireDelaySec: 0
5788
# See https://github.com/go-graphite/carbonzipper/blob/master/example.conf#L70-L108 for format explanation
5889
logger:
5990
- logger: ""

conf/etc/go-carbon/go-carbon.conf

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,134 @@ enabled = true
5757
# Optional internal queue between receiver and cache
5858
buffer-size = 0
5959

60+
# You can define unlimited count of additional receivers
61+
# Common definition scheme:
62+
# [receiver.<any receiver name>]
63+
# protocol = "<any supported protocol>"
64+
# <protocol specific options>
65+
#
66+
# All available protocols:
67+
#
68+
# [receiver.udp2]
69+
# protocol = "udp"
70+
# listen = ":2003"
71+
# # Enable optional logging of incomplete messages (chunked by max UDP packet size)
72+
# log-incomplete = false
73+
#
74+
# [receiver.tcp2]
75+
# protocol = "tcp"
76+
# listen = ":2003"
77+
#
78+
# [receiver.pickle2]
79+
# protocol = "pickle"
80+
# listen = ":2004"
81+
# # Limit message size for prevent memory overflow
82+
# max-message-size = 67108864
83+
#
84+
# [receiver.protobuf]
85+
# protocol = "protobuf"
86+
# # Same framing protocol as pickle, but message encoded in protobuf format
87+
# # See https://github.com/lomik/go-carbon/blob/master/helper/carbonpb/carbon.proto
88+
# listen = ":2005"
89+
# # Limit message size for prevent memory overflow
90+
# max-message-size = 67108864
91+
#
92+
# [receiver.http]
93+
# protocol = "http"
94+
# # This receiver receives data from POST requests body.
95+
# # Data can be encoded in plain text format (default),
96+
# # protobuf (with Content-Type: application/protobuf header) or
97+
# # pickle (with Content-Type: application/python-pickle header).
98+
# listen = ":2007"
99+
# max-message-size = 67108864
100+
#
101+
# [receiver.kafka]
102+
# protocol = "kafka
103+
# # This receiver receives data from kafka
104+
# # You can use Partitions and Topics to do sharding
105+
# # State is saved in local file to avoid problems with multiple consumers
106+
#
107+
# # Encoding of messages
108+
# # Available options: "plain" (default), "protobuf", "pickle"
109+
# # Please note that for "plain" you must pass metrics with leading "\n".
110+
# # e.x.
111+
# # echo "test.metric $(date +%s) $(date +%s)" | kafkacat -D $'\0' -z snappy -T -b localhost:9092 -t graphite
112+
# parse-protocol = "protobuf"
113+
# # Kafka connection parameters
114+
# brokers = [ "host1:9092", "host2:9092" ]
115+
# topic = "graphite"
116+
# partition = 0
117+
#
118+
# # Specify how often receiver will try to connect to kafka in case of network problems
119+
# reconnect-interval = "5m"
120+
# # How often receiver will ask Kafka for new data (in case there was no messages available to read)
121+
# fetch-interval = "200ms"
122+
#
123+
# # Path to saved kafka state. Used for restarts
124+
# state-file = "/var/lib/graphite/kafka.state"
125+
# # Initial offset, if there is no saved state. Can be relative time or "newest" or "oldest".
126+
# # In case offset is unavailable (in future, etc) fallback is "oldest"
127+
# initial-offset = "-30m"
128+
#
129+
# # Specify kafka feature level (default: 0.11.0.0).
130+
# # Please note that some features (consuming lz4 compressed streams) requires kafka >0.11
131+
# # You must specify version in full. E.x. '0.11.0.0' - ok, but '0.11' is not.
132+
# # Supported version (as of 22 Jan 2018):
133+
# # 0.8.2.0
134+
# # 0.8.2.1
135+
# # 0.8.2.2
136+
# # 0.9.0.0
137+
# # 0.9.0.1
138+
# # 0.10.0.0
139+
# # 0.10.0.1
140+
# # 0.10.1.0
141+
# # 0.10.2.0
142+
# # 0.11.0.0
143+
# # 1.0.0
144+
# kafka-version = "0.11.0.0"
145+
#
146+
# [receiver.pubsub]
147+
# # This receiver receives data from Google PubSub
148+
# # - Authentication is managed through APPLICATION_DEFAULT_CREDENTIALS:
149+
# # - https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application
150+
# # - Currently the subscription must exist before running go-carbon.
151+
# # - The "receiver_*" settings are optional and directly map to the google pubsub
152+
# # libraries ReceiveSettings (https://godoc.org/cloud.google.com/go/pubsub#ReceiveSettings)
153+
# # - How to think about the "receiver_*" settings: In an attempt to maximize throughput the
154+
# # pubsub library will spawn 'receiver_go_routines' to fetch messages from the server.
155+
# # These goroutines simply buffer them into memory until 'receiver_max_messages' or 'receiver_max_bytes'
156+
# # have been read. This does not affect the actual handling of these messages which are processed by other goroutines.
157+
# protocol = "pubsub"
158+
# project = "project-name"
159+
# subscription = "subscription-name"
160+
# receiver_go_routines = 4
161+
# receiver_max_messages = 1000
162+
# receiver_max_bytes = 500000000 # default 500MB
163+
60164
[carbonlink]
61165
listen = "127.0.0.1:7002"
62166
enabled = false
63167
# Close inactive connections after "read-timeout"
64168
read-timeout = "30s"
65169

170+
# grpc api
171+
# protocol: https://github.com/lomik/go-carbon/blob/master/helper/carbonpb/carbon.proto
172+
# samples: https://github.com/lomik/go-carbon/tree/master/api/sample
173+
[grpc]
174+
listen = "127.0.0.1:7003"
175+
enabled = true
176+
177+
# http://graphite.readthedocs.io/en/latest/tags.html
178+
[tags]
179+
enabled = false
180+
# TagDB url. It should support /tags/tagMultiSeries endpoint
181+
tagdb-url = "http://127.0.0.1:8000"
182+
tagdb-chunk-size = 32
183+
# Directory for send queue (based on leveldb)
184+
local-dir = "/var/lib/graphite/tagging/"
185+
# POST timeout
186+
tagdb-timeout = "1s"
187+
66188
[carbonserver]
67189
# Please NOTE: carbonserver is not intended to fully replace graphite-web
68190
# It acts as a "REMOTE_STORAGE" for graphite-web or carbonzipper/carbonapi
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# config file version
2+
apiVersion: 1
3+
4+
## list of datasources that should be deleted from the database
5+
#deleteDatasources:
6+
# - name: Graphite
7+
# orgId: 1
8+
9+
# list of datasources to insert/update depending
10+
# whats available in the database
11+
datasources:
12+
# <string, required> name of the datasource. Required
13+
- name: carbonapi
14+
# <string, required> datasource type. Required
15+
type: graphite
16+
# <string, required> access mode. direct or proxy. Required
17+
access: proxy
18+
# <int> org id. will default to orgId 1 if not specified
19+
orgId: 1
20+
# <string> url
21+
url: http://127.0.0.1:8081
22+
# <string> database password, if used
23+
password:
24+
# <string> database user, if used
25+
user:
26+
# <string> database name, if used
27+
database:
28+
# <bool> enable/disable basic auth
29+
basicAuth:
30+
# <string> basic auth username
31+
basicAuthUser:
32+
# <string> basic auth password
33+
basicAuthPassword:
34+
# <bool> enable/disable with credentials headers
35+
withCredentials:
36+
# <bool> mark as default datasource. Max one per org
37+
isDefault: true
38+
# <map> fields that will be converted to json and stored in json_data
39+
jsonData:
40+
graphiteVersion: "1.0"
41+
# <bool> allow users to edit datasources from the UI.
42+
editable: true

0 commit comments

Comments
 (0)