Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
# Demo database and file number directories
*.db
trackers/

# Local IDE settings
.vscode/settings.json
45 changes: 45 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'numtracker'",
"cargo": {
"args": [
"build",
"--bin=numtracker",
"--package=numtracker"
],
"filter": {
"name": "numtracker",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'numtracker'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=numtracker",
"--package=numtracker"
],
"filter": {
"name": "numtracker",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
82 changes: 57 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ dirs = { version = "6.0.0", optional = true }
graphql_client = { version = "0.16.0", optional = true }
openidconnect = { version = "4.0.0", optional = true }
toml = { version = "1.0.0", optional = true }
tracing-gelf = "0.9.0"
thiserror = "2.0.18"

[dev-dependencies]
assert_matches = "1.5.0"
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ Additional logging output is available via `-v` verbose flags.
| `-vv` |Debug|
| `-vvv` |Trace|

### Graylog

Logs can be sent to a [Graylog][_graylog] instance using the `--graylog` flag:

```bash
cargo run -- --graylog tcp://graylog.example.com:12201 serve
```

The minimum log level sent to Graylog can be set independently of the stderr
output level using `--logging-level` (default: `INFO`):

```bash
cargo run -- --graylog tcp://graylog.example.com:12201 --logging-level WARN serve
```

Both options can also be set via environment variables:
- `NUMTRACKER_GRAYLOG` — Graylog URL
- `NUMTRACKER_GRAYLOG_LOG_LEVEL` — log level (`TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`)

## Schema

The schema is available via the `schema` command. This is also available via the
Expand Down Expand Up @@ -405,4 +424,5 @@ $ numtracker client visit-directory i22 cm12345-6
```

[_graphiql]:https://github.com/graphql/graphiql/
[_graylog]:https://graylog.org/
[_jq]:https://jqlang.github.io/jq/
6 changes: 6 additions & 0 deletions helm/numtracker/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ spec:
- name: NUMTRACKER_TRACING_LEVEL
value: {{ .Values.numtracker.tracing.level }}
{{- end }}
{{- if .Values.numtracker.graylog.enabled }}
- name: NUMTRACKER_GRAYLOG
value: {{ .Values.numtracker.graylog.host }}
- name: NUMTRACKER_GRAYLOG_LOG_LEVEL
value: {{ .Values.numtracker.graylog.level }}
{{- end }}
{{- if .Values.numtracker.auth.enabled }}
- name: NUMTRACKER_AUTH_HOST
value: {{ .Values.numtracker.auth.host }}
Expand Down
4 changes: 4 additions & 0 deletions helm/numtracker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ numtracker:
enabled: false
level: DEBUG
# host: OTEL compatible host
graylog:
enabled: false
level: INFO
# host: DAQ Graylog GELF TCP input eg. tcp://graylog-log-target.diamond.ac.uk:12231
auth:
enabled: false
# host: OPA instance
Expand Down
Loading