Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding provisioning and server db config docs #2322

Merged
merged 25 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
efee85a
Adding provisioning and server db config docs
kdhamric Apr 6, 2023
e7b6e3a
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
d427433
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
2273278
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
270b10d
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
8c56841
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
dae2477
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
04f9233
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
19880b8
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
bf15ba2
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
d516291
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
ce2fc29
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
b715983
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
3124ee7
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
0e9c551
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
f28f763
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
965a23f
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
b414d67
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
bda8e47
Update docs/sidebars.js
kdhamric Apr 6, 2023
2644606
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
f5d2623
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
1975869
Update docs/docs/configuration/server.md
kdhamric Apr 6, 2023
8a74a65
Update server.md
kdhamric Apr 6, 2023
7111716
Update docs/docs/configuration/provisioning.md
kdhamric Apr 6, 2023
cd0d026
Update server.md
kdhamric Apr 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions docs/docs/configuration/overview.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Configuration Overview

There is one way you can set configuration options in Tracetest. By using a configuration file, commonly known as the `tracetest.config.yaml` file.

When using Docker, ensure that the configuration file is mounted to `/app/config.yaml` within the Tracetest Docker container.

<!-- To view all the configuration options see the [config file reference page](./config-file-reference). -->
There are several configuration options with Tracetest:
- [Server configuration](./server) to set database connection information needed to connect to required PostgreSQL instance.
- [Provisioning configuration](./provisioning) to 'preload' the Tracetest server with resources when first running the Tracetest server.

## Supported Trace Data Stores

Expand Down
49 changes: 49 additions & 0 deletions docs/docs/configuration/provisioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Provisioning server

Tracetest allows a server to be provisioned the first time a new Tracetest server is installed and launched. Provisioning sets certain resources in the server to the specified values, allowing you to configure the server. It is convenient in a CI/CD flow where you want to launch a server with a specified configuration.
kdhamric marked this conversation as resolved.
Show resolved Hide resolved

The server is provisioned by specifying a series of YAML snippets which will configure various resources. Each snippet is separated with the YAML separator, `---`.

Currently, the following resources can be provisioned:
- DataStore
- PollingProfile
- Config
- Demo

For Docker-based installs, the provisioning file is placed in the `./tracetest/tracetest-provisioning.yaml` file by default when you run the `tracetest server install` command and select the `Using Docker Compose` option. The first time you start Tracetest with a `docker compose -f tracetest/docker-compose.yaml up -d` command, the server will use the contents of this file to provision the server. To provision differently, you would alter the contents of the `tracetest-provisioning.yaml` file before launching Tracetest in Docker.

This is an example of a `tracetest-provisioning.yaml` file:

```yaml
---
type: DataStore
spec:
name: otlp
type: otlp
isdefault: true
---
type: Config
spec:
analyticsEnabled: true
---
type: PollingProfile
spec:
name: Custom Profile
strategy: periodic
default: true
periodic:
timeout: 2m
retryDelay: 3s
---
type: Demo
spec:
name: pokeshop
type: pokeshop
enabled: true
pokeshop:
httpEndpoint: http://demo-api:8081
grpcEndpoint: demo-api:8082
```

Alternatively, we support setting an environment variable called `TRACETEST_PROVISIONING` to provision the server when it is first started. Base64 encode the provisioning YAML you want to utilize and set the `TRACETEST_PROVISIONING` environment variable with the result. The Tracetest server will then provision based on the Base64 encoded provisioning data in this environment variable the first time it is launched.

31 changes: 31 additions & 0 deletions docs/docs/configuration/server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Configuring the Tracetest Server

Tracetest requires a very minimal configuration to be launched, needing just the connection information to connect with the PostgreSQL database which is installed as part of the server install. There are a couple of ways to provide this database connection information.

For Docker-based installs, the server configuration file is placed in the `./tracetest/tracetest.yaml` file by default when you run the `tracetest server install` command and select the `Using Docker Compose` option. The configuration file is mounted to `/app/config.yaml` within the Tracetest Docker container. When Tracetest is run with a `docker compose -f tracetest/docker-compose.yaml up -d` command, the server will use the contents of this file to connect to the Postgres database. All other configuration data is stored in the Postgres instance.

This is an example of a `tracetest.yaml` file:

```yaml
postgres:
host: postgres
user: postgres
password: postgres
port: 5432
dbname: postgres
params: sslmode=disable
```

Alternatively, we support setting a series of environment variables which can contain the connection information for the Postgres instance. If these environment variables are set, they will be used by the Tracetest server to connect to the database.

The list of environment variables and example values is:
- `TRACETEST_POSTGRES_HOST: "postgres"`
- `TRACETEST_POSTGRES_PORT: "5432"`
- `TRACETEST_POSTGRES_DBNAME: "postgres"`
- `TRACETEST_POSTGRES_USER: "postgres"`
- `TRACETEST_POSTGRES_PASSWORD: "postgres"`
kdhamric marked this conversation as resolved.
Show resolved Hide resolved
- `TRACETEST_POSTGRES_PARAMS: ""`


You can also intitalize the server with a number of resources the first time it is launched by using [provisioning](./provisioning).

10 changes: 10 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ const sidebars = {
id: "configuration/opentelemetry-collector-configuration-file-reference",
label: "OpenTelemetry Collector Configuration File Reference",
},
{
type: "doc",
id: "configuration/server",
label: "Tracetest Server Configuration",
},
{
type: "doc",
id: "configuration/provisioning",
label: "Provisioning a Tracetest Server",
},
{
type: "doc",
id: "configuration/trace-polling",
Expand Down