Skip to content

Commit

Permalink
chore: add LOGFLARE_LOGGER_METADATA_CLUSTER for adding global metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Jan 22, 2024
1 parent 9f225b2 commit 13a8a38
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cloudbuild/prod/pre-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ steps:
- --container-image=${_CONTAINER_IMAGE}
- --container-privileged
- --container-restart-policy=always
- --container-env=LOGFLARE_GRPC_PORT=4001,LOGFLARE_MIN_CLUSTER_SIZE=2,RELEASE_COOKIE=${_COOKIE}
- --container-env=LOGFLARE_GRPC_PORT=4001,LOGFLARE_MIN_CLUSTER_SIZE=2,RELEASE_COOKIE=${_COOKIE},LOGFLARE_LOGGER_METADATA_CLUSTER=${_CLUSTER}
- --no-shielded-secure-boot
- --shielded-vtpm
- --shielded-integrity-monitoring
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild/staging/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ steps:
- --metadata=google-monitoring-enabled=true,google-logging-enabled=true
- --container-privileged
- --container-restart-policy=always
- --container-env=LOGFLARE_GRPC_PORT=4001,RELEASE_COOKIE=${_COOKIE}
- --container-env=LOGFLARE_GRPC_PORT=4001,RELEASE_COOKIE=${_COOKIE},LOGFLARE_LOGGER_METADATA_CLUSTER=${_CLUSTER}
- --no-shielded-secure-boot
- --shielded-vtpm
- --shielded-integrity-monitoring
Expand Down
5 changes: 5 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ config :logger,
]
|> Enum.filter(&(&1 != nil))

config :logger,
metadata:
[cluster: System.get_env("LOGFLARE_LOGGER_METADATA_CLUSTER")]
|> filter_nil_kv_pairs.()

log_level =
case String.downcase(System.get_env("LOGFLARE_LOG_LEVEL") || "") do
"warn" -> :warn
Expand Down
19 changes: 10 additions & 9 deletions docs/docs.logflare.com/docs/self-hosting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ All browser authentication will be disabled when in single-tenant mode.

### Common Configuration

| Env Var | Type | Description |
| ------------------------ | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `LOGFLARE_SINGLE_TENANT` | Boolean, defaults to `false` | If enabled, a singular user will be seeded. All browser usage will default to the user. |
| `LOGFLARE_API_KEY` | string, defaults to `nil` | If set, this API Key can be used for interacting with the Logflare API. API key will be automatically generated if not set. |
| `LOGFLARE_SUPABASE_MODE` | Boolean, defaults to `false` | A special mode for Logflare, where Supabase-specific resources will be seeded. Intended for Suapbase self-hosted usage. |
| `PHX_HTTP_PORT` | Integer, defaults to `4000` | Allows configuration of the HTTP server port. |
| `DB_SCHEMA` | String, defaults to `nil` | Allows configuration of the database schema to scope Logflare operations. |
| `LOGFLARE_LOG_LEVEL` | String, defaults to `info`. <br/>Options: `error`,`warn`, `info`, `debug` | Allows runtime configuration of log level. |
| `LOGFLARE_NODE_HOST` | string, defaults to `127.0.0.1` | Sets node host on startup, which affects the node name `logflare@<host>` |
| Env Var | Type | Description |
| ---------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `LOGFLARE_SINGLE_TENANT` | Boolean, defaults to `false` | If enabled, a singular user will be seeded. All browser usage will default to the user. |
| `LOGFLARE_API_KEY` | string, defaults to `nil` | If set, this API Key can be used for interacting with the Logflare API. API key will be automatically generated if not set. |
| `LOGFLARE_SUPABASE_MODE` | Boolean, defaults to `false` | A special mode for Logflare, where Supabase-specific resources will be seeded. Intended for Suapbase self-hosted usage. |
| `PHX_HTTP_PORT` | Integer, defaults to `4000` | Allows configuration of the HTTP server port. |
| `DB_SCHEMA` | String, defaults to `nil` | Allows configuration of the database schema to scope Logflare operations. |
| `LOGFLARE_LOG_LEVEL` | String, defaults to `info`. <br/>Options: `error`,`warn`, `info`, `debug` | Allows runtime configuration of log level. |
| `LOGFLARE_NODE_HOST` | string, defaults to `127.0.0.1` | Sets node host on startup, which affects the node name `logflare@<host>` |
| `LOGFLARE_LOGGER_METADATA_CLUSTER` | string, defaults to `nil` | Sets global logging metadata for the cluster name. Useful for filtering logs by cluster name. |

### BigQuery Backend Configuration

Expand Down

0 comments on commit 13a8a38

Please sign in to comment.