-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
395 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Grafana Tempo | ||
|
||
[Grafana Tempo](https://grafana.com/docs/tempo/latest/) is an open-source, easy-to-use, and high-scale distributed tracing backend. Tempo lets you search for traces, generate metrics from spans, and link your tracing data with logs and metrics. | ||
|
||
## Getting Started | ||
|
||
```nix | ||
# In `perSystem.process-compose.<name>` | ||
{ | ||
services.tempo."tp1".enable = true; | ||
} | ||
``` | ||
|
||
{#tips} | ||
## Tips & Tricks | ||
|
||
{#usage-with-grafana} | ||
### Usage with Grafana | ||
|
||
To add tempo as a datasource to #[[grafana]], we can use the following config: | ||
|
||
```nix | ||
{ | ||
services.tempo.tp1.enable = true; | ||
services.grafana.gf1 = { | ||
enable = true; | ||
datasources = with config.services.tempo.tp1; [{ | ||
name = "Tempo"; | ||
type = "tempo"; | ||
access = "proxy"; | ||
url = "http://${httpAddress}:${builtins.toString httpPort}"; | ||
}]; | ||
}; | ||
settings.processes."gf1".depends_on."tp1".condition = "process_healthy"; | ||
} | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
description = "A demo of grafana with tempo"; | ||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
systems.url = "github:nix-systems/default"; | ||
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake"; | ||
services-flake.url = "git+file:///Volumes/Code/services-flake"; | ||
}; | ||
outputs = inputs: | ||
inputs.flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = import inputs.systems; | ||
imports = [ | ||
inputs.process-compose-flake.flakeModule | ||
]; | ||
perSystem = { self', pkgs, lib, ... }: { | ||
# `process-compose.foo` will add a flake package output called "foo". | ||
# Therefore, this will add a default package that you can build using | ||
# `nix build` and run using `nix run`. | ||
process-compose."default" = { config, ... }: { | ||
imports = [ | ||
inputs.services-flake.processComposeModules.default | ||
]; | ||
|
||
services.tempo."tp1".enable = true; | ||
services.grafana."gf1" = { | ||
enable = true; | ||
datasources = with config.services.tempo.tp1; [{ | ||
name = "Tempo"; | ||
type = "tempo"; | ||
access = "proxy"; | ||
url = "http://${httpAddress}:${builtins.toString httpPort}"; | ||
}]; | ||
}; | ||
}; | ||
|
||
devShells.default = pkgs.mkShell { | ||
nativeBuildInputs = [ pkgs.just ]; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
default: | ||
nix run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,6 @@ in | |
./prometheus.nix | ||
./pgadmin.nix | ||
./cassandra.nix | ||
./tempo.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.