Skip to content

Commit

Permalink
Merge pull request #580 from grafana/owilliams/mainbranch
Browse files Browse the repository at this point in the history
build: rename master to main throughout
  • Loading branch information
ywwg authored Jan 7, 2025
2 parents c4a99b7 + 062bb61 commit 3293ce1
Show file tree
Hide file tree
Showing 19 changed files with 107 additions and 107 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+**
pull_request:
Expand Down Expand Up @@ -104,9 +104,9 @@ jobs:
version=$(cat build/version.txt)
docker push grafana/carbon-relay-ng:$version
# only versions without a hyphen - e.g. actual releases - are tagged as latest.
# in-between-release versions are tagged as master.
# in-between-release versions are tagged as main.
tag=latest
[[ ! "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && tag=master
[[ ! "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && tag=main
docker push grafana/carbon-relay-ng:$tag
github_binaries:
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ See https://hub.docker.com/r/grafana/carbon-relay-ng for all Docker image update

* BREAKING: switch to logrus for logging. #317, #326
If you were previously using log level notice, you should now use info.
See [logging docs](https://github.com/grafana/carbon-relay-ng/blob/master/docs/logging.md) for more info on the log levels.
See [logging docs](https://github.com/grafana/carbon-relay-ng/blob/main/docs/logging.md) for more info on the log levels.
* IMPORTANT: refactor release process, docker tags and package repo. #330, #331
see [installation docs](https://github.com/grafana/carbon-relay-ng/blob/master/docs/installation-building.md)
see [installation docs](https://github.com/grafana/carbon-relay-ng/blob/main/docs/installation-building.md)
* fix memory leak when connections should be closed. #259, #329
* Rewrite of the inputs. pickle, tcp, udp and data reading.
They are now plugins, handle errors better, and support timeouts.
Expand Down Expand Up @@ -196,7 +196,7 @@ show target address for GrafanaNet routes #244
rule of thumb: rate in metrics/s times how many seconds you want to be able to buffer in case of downstream issues. memory used will be `bufSize * 100B` or use `bufSize * 150B` to be extra safe.
- blocking: when the route's buffer fills up, ingestion into the route will slow down/block, providing backpressure to the clients, and also blocking other routes from making progress. use this only if you know what you're doing and have smart clients that can gracefully handle the backpressure
* monitor queue drops for non-blocking queues
* [document route options better](https://github.com/grafana/carbon-relay-ng/blob/master/docs/routes.md)
* [document route options better](https://github.com/grafana/carbon-relay-ng/blob/main/docs/routes.md)
* monitor queue size and ram used #218
* preliminary support for parsing out the new graphite tag format (kafkaMdm and grafanaNet route only)

Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/grafana/carbon-relay-ng)](https://goreportcard.com/report/github.com/grafana/carbon-relay-ng)
[![GoDoc](https://godoc.org/github.com/grafana/carbon-relay-ng?status.svg)](https://godoc.org/github.com/grafana/carbon-relay-ng)

<a href="https://github.com/grafana/carbon-relay-ng/actions/workflows/ci.yaml?query=branch%3Amaster"><img src="https://github.com/grafana/carbon-relay-ng/actions/workflows/ci.yaml/badge.svg?query=branch%3Amaster" alt="Build" /></a>
<a href="https://github.com/grafana/carbon-relay-ng/actions/workflows/ci.yaml?query=branch%3Amain"><img src="https://github.com/grafana/carbon-relay-ng/actions/workflows/ci.yaml/badge.svg?query=branch%3Amain" alt="Build" /></a>


carbon-relay-ng
Expand All @@ -24,24 +24,24 @@ Or balance/split load, or provide redundancy, or partition the data, etc.
This pattern allows alerting and event processing systems to act on the data as it is received (which is much better than repeated reading from your storage)


![screenshot](https://raw.githubusercontent.com/grafana/carbon-relay-ng/master/screenshots/screenshot.png)
![screenshot](https://raw.githubusercontent.com/grafana/carbon-relay-ng/main/screenshots/screenshot.png)

Documentation
=============

* [configuration](https://github.com/grafana/carbon-relay-ng/blob/master/docs/config.md)
* [input](https://github.com/grafana/carbon-relay-ng/blob/master/docs/input.md)
* [validation](https://github.com/grafana/carbon-relay-ng/blob/master/docs/validation.md)
* [rewriting](https://github.com/grafana/carbon-relay-ng/blob/master/docs/rewriting.md)
* [aggregation](https://github.com/grafana/carbon-relay-ng/blob/master/docs/aggregation.md)
* [monitoring](https://github.com/grafana/carbon-relay-ng/blob/master/docs/monitoring.md)
* [TCP admin interface](https://github.com/grafana/carbon-relay-ng/blob/master/docs/tcp-admin-interface.md)
* [current changelog](https://github.com/grafana/carbon-relay-ng/blob/master/CHANGELOG.md) and [official releasess](https://github.com/grafana/carbon-relay-ng/releases)
* [release process](https://github.com/grafana/carbon-relay-ng/blob/master/docs/installation-building.md#release-process)
* [limitations](https://github.com/grafana/carbon-relay-ng/blob/master/docs/limitations.md)
* [installation and building](https://github.com/grafana/carbon-relay-ng/blob/master/docs/installation-building.md)
* [Deploying on Kubernetes](https://github.com/grafana/carbon-relay-ng/blob/master/docs/deploying-on-k8s.md)
* [Troubleshooting](https://github.com/grafana/carbon-relay-ng/blob/master/docs/troubleshooting.md)
* [configuration](https://github.com/grafana/carbon-relay-ng/blob/main/docs/config.md)
* [input](https://github.com/grafana/carbon-relay-ng/blob/main/docs/input.md)
* [validation](https://github.com/grafana/carbon-relay-ng/blob/main/docs/validation.md)
* [rewriting](https://github.com/grafana/carbon-relay-ng/blob/main/docs/rewriting.md)
* [aggregation](https://github.com/grafana/carbon-relay-ng/blob/main/docs/aggregation.md)
* [monitoring](https://github.com/grafana/carbon-relay-ng/blob/main/docs/monitoring.md)
* [TCP admin interface](https://github.com/grafana/carbon-relay-ng/blob/main/docs/tcp-admin-interface.md)
* [current changelog](https://github.com/grafana/carbon-relay-ng/blob/main/CHANGELOG.md) and [official releasess](https://github.com/grafana/carbon-relay-ng/releases)
* [release process](https://github.com/grafana/carbon-relay-ng/blob/main/docs/installation-building.md#release-process)
* [limitations](https://github.com/grafana/carbon-relay-ng/blob/main/docs/limitations.md)
* [installation and building](https://github.com/grafana/carbon-relay-ng/blob/main/docs/installation-building.md)
* [Deploying on Kubernetes](https://github.com/grafana/carbon-relay-ng/blob/main/docs/deploying-on-k8s.md)
* [Troubleshooting](https://github.com/grafana/carbon-relay-ng/blob/main/docs/troubleshooting.md)


Concepts
Expand All @@ -52,12 +52,12 @@ You have 1 master routing table. This table contains 0-N routes. There's diffe
First: "matching": you can match metrics on one or more of: prefix, substring, or regex. All 3 default to "" (empty string, i.e. allow all).
The conditions are AND-ed. Regexes are more resource intensive and hence should - and often can be - avoided.

* All incoming metrics are [validated](https://github.com/grafana/carbon-relay-ng/blob/master/docs/validation.md) and go into the table when valid.
* The table will then check metrics against the [blocklist](https://github.com/grafana/carbon-relay-ng/blob/master/docs/config.md#blocklist) and discard when appropriate.
* Then metrics pass through the [rewriters](https://github.com/grafana/carbon-relay-ng/blob/master/docs/rewriting.md) and are modified if applicable. Rewrite rules wrapped with forward slashes are interpreted as regular expressions.
* All incoming metrics are [validated](https://github.com/grafana/carbon-relay-ng/blob/main/docs/validation.md) and go into the table when valid.
* The table will then check metrics against the [blocklist](https://github.com/grafana/carbon-relay-ng/blob/main/docs/config.md#blocklist) and discard when appropriate.
* Then metrics pass through the [rewriters](https://github.com/grafana/carbon-relay-ng/blob/main/docs/rewriting.md) and are modified if applicable. Rewrite rules wrapped with forward slashes are interpreted as regular expressions.
* The table sends the metric to:
* the [aggregators](https://github.com/grafana/carbon-relay-ng/blob/master/docs/aggregation.md), who match the metrics against their rules, compute aggregations and feed results back into the table. see Aggregation section below for details.
* any [routes](https://github.com/grafana/carbon-relay-ng/blob/master/docs/config.md#routes) that matches
* the [aggregators](https://github.com/grafana/carbon-relay-ng/blob/main/docs/aggregation.md), who match the metrics against their rules, compute aggregations and feed results back into the table. see Aggregation section below for details.
* any [routes](https://github.com/grafana/carbon-relay-ng/blob/main/docs/config.md#routes) that matches
* The route can have different behaviors, based on its type:

* for grafanaNet / kafkaMdm / Google PubSub routes, there is only a single endpoint so that's where the data goes. For standard/carbon routes you can control how data gets routed into destinations (note that destinations have settings to match on prefix/sub/regex, just like routes):
Expand Down
4 changes: 2 additions & 2 deletions build_docker.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
version=$(git describe --tags --always | sed 's/^v//')

# only tag as latest if we're in master branch and the version tag has no hyphen in it.
# only tag as latest if we're in main branch and the version tag has no hyphen in it.
# note: we may want to extend this to also not tag as latest if working tree is dirty.
# but i think because of how go bindata works, it probably makes a change in the working tree.
tag=master
tag=main
[[ "$GITHUB_EVENT_NAME" = "push" ]] && [[ "$GITHUB_REF_TYPE" = "tag" ]] && [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && tag=latest


Expand Down
2 changes: 1 addition & 1 deletion cfg/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func InitRoutes(table table.Interface, config Config, meta toml.MetaData) error
cfg, err := route.NewGrafanaNetConfig(routeConfig.Addr, routeConfig.ApiKey, routeConfig.SchemasFile, routeConfig.AggregationFile)
if err != nil {
log.Error(err.Error())
log.Info("grafanaNet route configuration details: https://github.com/grafana/carbon-relay-ng/blob/master/docs/config.md#grafananet-route")
log.Info("grafanaNet route configuration details: https://github.com/grafana/carbon-relay-ng/blob/main/docs/config.md#grafananet-route")
return fmt.Errorf("error adding route '%s'", routeConfig.Key)
}

Expand Down
30 changes: 15 additions & 15 deletions docs/aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ The output of the aggregation bucket (after the wait timer expires) is then 1 po

## functions

Available functions:

function | output
---------------|----------------------------------------------
avg | average (mean)
count | number of points/values seen (count of items in the bucket)
delta | difference between highest and lowest value seen
derive | derivative (needs at least 2 input values. if more, derives from oldest to newest)
last | last value seen in the bucket
max | max value seen in the bucket
min | min value seen in the bucket
stdev | standard devation
sum | sum
percentiles | a set of different percentiles
Available functions:

| function | output |
| ----------- | ---------------------------------------------------------------------------------- |
| avg | average (mean) |
| count | number of points/values seen (count of items in the bucket) |
| delta | difference between highest and lowest value seen |
| derive | derivative (needs at least 2 input values. if more, derives from oldest to newest) |
| last | last value seen in the bucket |
| max | max value seen in the bucket |
| min | min value seen in the bucket |
| stdev | standard devation |
| sum | sum |
| percentiles | a set of different percentiles |

## configuration

Expand All @@ -85,7 +85,7 @@ With a wait of 120, metrics can come 2 minutes after the start of the interval a

* `dropRaw=true` will prevent any further processing of the raw series "consumed" by an aggregator with this option enabled. It causes the original input series to disappear from the routing table. This can be useful for managing cardinality and for quantizing metrics sent at odd intervals. When using `dropRaw` an aggregator may produce a series with the same name as the input series. Note that this option may slow down table processing, especially with a cold or disabled aggregator cache.

[config examples](https://github.com/grafana/carbon-relay-ng/blob/master/docs/config.md#aggregators)
[config examples](https://github.com/grafana/carbon-relay-ng/blob/main/docs/config.md#aggregators)

## output

Expand Down
2 changes: 1 addition & 1 deletion docs/deploying-on-k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ tk apply environments/default
For users who don't use Tanka, we also provide yaml files which can be used as templates to
create the necessary resources to deploy carbon-relay-ng.

The yaml files are in the directory [/examples/k8s](https://github.com/grafana/carbon-relay-ng/tree/master/examples/k8s).
The yaml files are in the directory [/examples/k8s](https://github.com/grafana/carbon-relay-ng/tree/main/examples/k8s).
18 changes: 9 additions & 9 deletions docs/installation-building.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Installation

## Release vs latest master
## Release vs latest main

Typically, some new code was added to master since the last release.
See the [changelog](https://github.com/grafana/carbon-relay-ng/blob/master/CHANGELOG.md) or look at the [git log](https://github.com/grafana/carbon-relay-ng/commits/master) for the most up to date information.
Typically, some new code was added to main since the last release.
See the [changelog](https://github.com/grafana/carbon-relay-ng/blob/main/CHANGELOG.md) or look at the [git log](https://github.com/grafana/carbon-relay-ng/commits/main) for the most up to date information.
This may help you decide whether you want the latest release, or the latest code.

## Linux distribution packages
Expand All @@ -28,7 +28,7 @@ See [dockerhub](https://hub.docker.com/r/grafana/carbon-relay-ng/).
You can use these tags:

* `latest`: the latest official stable release
* `master`: latest build from master. these versions typically bring improvements but possibly also new bugs
* `main`: latest build from main. these versions typically bring improvements but possibly also new bugs


# Building from source
Expand All @@ -42,7 +42,7 @@ These commands will install the binary as `$GOPATH/bin/carbon-relay-ng`
cd $GOPATH/src/github.com/grafana/
git clone https://github.com/grafana/carbon-relay-ng.git
cd carbon-relay-ng
# e.g. to check out a specific version instead of master:
# e.g. to check out a specific version instead of main:
# git checkout v1.1
go install github.com/shuLhan/go-bindata/cmd/go-bindata
make
Expand All @@ -55,7 +55,7 @@ This leaves you with a binary that you can run with a config file like so:
Usage:
carbon-relay-ng version
carbon-relay-ng <path-to-config>
-block-profile-rate int
see https://golang.org/pkg/runtime/#SetBlockProfileRate
-cpuprofile string
Expand All @@ -68,10 +68,10 @@ Usage:
# Release process

During normal development, maintain CHANGELOG.md, and mark interesting -to users- changes under "unreleased" version.
Grafana Labs regularly deploys the latest code from `master`, but cannot possibly do extensive testing of all functionality in production, so users are encouraged to run master also, and report any issues they hit.
When interesting changes have been merged to master, and they have had a chance to be tested for a while, we tag a release, as follows:
Grafana Labs regularly deploys the latest code from `main`, but cannot possibly do extensive testing of all functionality in production, so users are encouraged to run main also, and report any issues they hit.
When interesting changes have been merged to main, and they have had a chance to be tested for a while, we tag a release, as follows:

* Update CHANGELOG.md from `unreleased` to the version. Create a PR and merge into the master branch. [Example PR](https://github.com/grafana/carbon-relay-ng/pull/512)
* Update CHANGELOG.md from `unreleased` to the version. Create a PR and merge into the main branch. [Example PR](https://github.com/grafana/carbon-relay-ng/pull/512)
* Create a git tag for the new version from the CHANGELOG commit merged from the PR and push the tag to GitHub.
Example for adding the v1.4.0 tag:
```
Expand Down
4 changes: 2 additions & 2 deletions docs/monitoring.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

* Extensive performance variables are available in json at http://localhost:8081/debug/vars2 (update port if you change it in config)
* You can also send metrics to graphite (or feed back into the relay), see config.
* Comes with a [grafana dashboard](https://github.com/grafana/carbon-relay-ng/blob/master/grafana-dashboard.json) which you can also [download from the grafana dashboards site](https://grafana.com/dashboards/338)
* Comes with a [grafana dashboard](https://github.com/grafana/carbon-relay-ng/blob/main/grafana-dashboard.json) which you can also [download from the grafana dashboards site](https://grafana.com/dashboards/338)

![grafana dashboard](https://raw.githubusercontent.com/grafana/carbon-relay-ng/master/screenshots/grafana-screenshot.png)
![grafana dashboard](https://raw.githubusercontent.com/grafana/carbon-relay-ng/main/screenshots/grafana-screenshot.png)

6 changes: 3 additions & 3 deletions docs/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Incoming metrics are validated in multiple steps:
3. order validation

Invalid metrics are dropped and - provided the message could be parsed - can be seen at /badMetrics/timespec.json where timespec is something like 30s, 10m, 24h, etc.
Carbon-relay-ng exports counters for invalid and out of order metrics (see [monitoring](https://github.com/grafana/carbon-relay-ng/blob/master/docs/monitoring.md))
Carbon-relay-ng exports counters for invalid and out of order metrics (see [monitoring](https://github.com/grafana/carbon-relay-ng/blob/main/docs/monitoring.md))

Let's clarify step 2 and 3.

Expand All @@ -26,7 +26,7 @@ First of all, if the key contains `=` or `_is_` we validate the key as metric2.0
#### standard carbon key

| Level | Description |
|------------------|---------------------------------------------------------------------------------------------------------------------------------|
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| none | no validation |
| medium (default) | ensure characters are 8-bit clean and not NULL. Optional tag appendix: see below |
| strict | medium + before appendix: block anything that can upset graphite: valid characters are `[A-Za-z0-9_-.]` and no consecutive dots |
Expand All @@ -45,7 +45,7 @@ Can be changed with `legacy_metric_validation` configuration parameter
#### metrics2.0

| Level | Description |
|------------------|----------------------------------------------------------------------------|
| ---------------- | -------------------------------------------------------------------------- |
| none | no validation |
| medium (default) | unit, mtype tag set. no mixing of `=` and `_is_` styles. at least two tags |
| strict | reserved for future |
Expand Down
Loading

0 comments on commit 3293ce1

Please sign in to comment.