Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a78fd2da
authored
Dec 19, 2025
by
Seefs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: document pyroscope env var
parent
fb0ffe8c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
4 deletions
+15
-4
.env.example
+2
-0
README.en.md
+2
-0
README.fr.md
+2
-0
README.ja.md
+2
-0
README.md
+2
-0
common/pyro.go
+5
-4
No files found.
.env.example
View file @
a78fd2da
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
# PYROSCOPE_APP_NAME=new-api
# PYROSCOPE_APP_NAME=new-api
# PYROSCOPE_BASIC_AUTH_USER=your-user
# PYROSCOPE_BASIC_AUTH_USER=your-user
# PYROSCOPE_BASIC_AUTH_PASSWORD=your-password
# PYROSCOPE_BASIC_AUTH_PASSWORD=your-password
# PYROSCOPE_MUTEX_RATE=5
# PYROSCOPE_BLOCK_RATE=5
# HOSTNAME=your-hostname
# HOSTNAME=your-hostname
# 数据库相关配置
# 数据库相关配置
...
...
README.en.md
View file @
a78fd2da
...
@@ -311,6 +311,8 @@ docker run --name new-api -d --restart always \
...
@@ -311,6 +311,8 @@ docker run --name new-api -d --restart always \
|
`PYROSCOPE_APP_NAME`
| Pyroscope application name |
`new-api`
|
|
`PYROSCOPE_APP_NAME`
| Pyroscope application name |
`new-api`
|
|
`PYROSCOPE_BASIC_AUTH_USER`
| Pyroscope basic auth user | - |
|
`PYROSCOPE_BASIC_AUTH_USER`
| Pyroscope basic auth user | - |
|
`PYROSCOPE_BASIC_AUTH_PASSWORD`
| Pyroscope basic auth password | - |
|
`PYROSCOPE_BASIC_AUTH_PASSWORD`
| Pyroscope basic auth password | - |
|
`PYROSCOPE_MUTEX_RATE`
| Pyroscope mutex sampling rate |
`5`
|
|
`PYROSCOPE_BLOCK_RATE`
| Pyroscope block sampling rate |
`5`
|
|
`HOSTNAME`
| Hostname tag for Pyroscope |
`new-api`
|
|
`HOSTNAME`
| Hostname tag for Pyroscope |
`new-api`
|
📖
**Complete configuration:**
[
Environment Variables Documentation
](
https://docs.newapi.pro/installation/environment-variables
)
📖
**Complete configuration:**
[
Environment Variables Documentation
](
https://docs.newapi.pro/installation/environment-variables
)
...
...
README.fr.md
View file @
a78fd2da
...
@@ -307,6 +307,8 @@ docker run --name new-api -d --restart always \
...
@@ -307,6 +307,8 @@ docker run --name new-api -d --restart always \
|
`PYROSCOPE_APP_NAME`
| Nom de l'application Pyroscope |
`new-api`
|
|
`PYROSCOPE_APP_NAME`
| Nom de l'application Pyroscope |
`new-api`
|
|
`PYROSCOPE_BASIC_AUTH_USER`
| Utilisateur Basic Auth Pyroscope | - |
|
`PYROSCOPE_BASIC_AUTH_USER`
| Utilisateur Basic Auth Pyroscope | - |
|
`PYROSCOPE_BASIC_AUTH_PASSWORD`
| Mot de passe Basic Auth Pyroscope | - |
|
`PYROSCOPE_BASIC_AUTH_PASSWORD`
| Mot de passe Basic Auth Pyroscope | - |
|
`PYROSCOPE_MUTEX_RATE`
| Taux d'échantillonnage mutex Pyroscope |
`5`
|
|
`PYROSCOPE_BLOCK_RATE`
| Taux d'échantillonnage block Pyroscope |
`5`
|
|
`HOSTNAME`
| Nom d'hôte tagué pour Pyroscope |
`new-api`
|
|
`HOSTNAME`
| Nom d'hôte tagué pour Pyroscope |
`new-api`
|
📖
**Configuration complète:**
[
Documentation des variables d'environnement
](
https://docs.newapi.pro/installation/environment-variables
)
📖
**Configuration complète:**
[
Documentation des variables d'environnement
](
https://docs.newapi.pro/installation/environment-variables
)
...
...
README.ja.md
View file @
a78fd2da
...
@@ -316,6 +316,8 @@ docker run --name new-api -d --restart always \
...
@@ -316,6 +316,8 @@ docker run --name new-api -d --restart always \
| `
PYROSCOPE_APP_NAME
` | Pyroscopeアプリ名 | `
new-api
` |
| `
PYROSCOPE_APP_NAME
` | Pyroscopeアプリ名 | `
new-api
` |
| `
PYROSCOPE_BASIC_AUTH_USER
` | Pyroscope Basic Authユーザー | - |
| `
PYROSCOPE_BASIC_AUTH_USER
` | Pyroscope Basic Authユーザー | - |
| `
PYROSCOPE_BASIC_AUTH_PASSWORD
` | Pyroscope Basic Authパスワード | - |
| `
PYROSCOPE_BASIC_AUTH_PASSWORD
` | Pyroscope Basic Authパスワード | - |
| `
PYROSCOPE_MUTEX_RATE
` | Pyroscope mutexサンプリング率 | `
5
` |
| `
PYROSCOPE_BLOCK_RATE
` | Pyroscope blockサンプリング率 | `
5
` |
| `
HOSTNAME
` | Pyroscope用のホスト名タグ | `
new-api
` |
| `
HOSTNAME
` | Pyroscope用のホスト名タグ | `
new-api
` |
📖 **完全な設定:** [環境変数ドキュメント](https://docs.newapi.pro/installation/environment-variables)
📖 **完全な設定:** [環境変数ドキュメント](https://docs.newapi.pro/installation/environment-variables)
...
...
README.md
View file @
a78fd2da
...
@@ -312,6 +312,8 @@ docker run --name new-api -d --restart always \
...
@@ -312,6 +312,8 @@ docker run --name new-api -d --restart always \
|
`PYROSCOPE_APP_NAME`
| Pyroscope 应用名 |
`new-api`
|
|
`PYROSCOPE_APP_NAME`
| Pyroscope 应用名 |
`new-api`
|
|
`PYROSCOPE_BASIC_AUTH_USER`
| Pyroscope Basic Auth 用户名 | - |
|
`PYROSCOPE_BASIC_AUTH_USER`
| Pyroscope Basic Auth 用户名 | - |
|
`PYROSCOPE_BASIC_AUTH_PASSWORD`
| Pyroscope Basic Auth 密码 | - |
|
`PYROSCOPE_BASIC_AUTH_PASSWORD`
| Pyroscope Basic Auth 密码 | - |
|
`PYROSCOPE_MUTEX_RATE`
| Pyroscope mutex 采样率 |
`5`
|
|
`PYROSCOPE_BLOCK_RATE`
| Pyroscope block 采样率 |
`5`
|
|
`HOSTNAME`
| Pyroscope 标签里的主机名 |
`new-api`
|
|
`HOSTNAME`
| Pyroscope 标签里的主机名 |
`new-api`
|
📖
**完整配置:**
[
环境变量文档
](
https://docs.newapi.pro/installation/environment-variables
)
📖
**完整配置:**
[
环境变量文档
](
https://docs.newapi.pro/installation/environment-variables
)
...
...
common/pyro.go
View file @
a78fd2da
...
@@ -18,10 +18,11 @@ func StartPyroScope() error {
...
@@ -18,10 +18,11 @@ func StartPyroScope() error {
pyroscopeBasicAuthPassword
:=
GetEnvOrDefaultString
(
"PYROSCOPE_BASIC_AUTH_PASSWORD"
,
""
)
pyroscopeBasicAuthPassword
:=
GetEnvOrDefaultString
(
"PYROSCOPE_BASIC_AUTH_PASSWORD"
,
""
)
pyroscopeHostname
:=
GetEnvOrDefaultString
(
"HOSTNAME"
,
"new-api"
)
pyroscopeHostname
:=
GetEnvOrDefaultString
(
"HOSTNAME"
,
"new-api"
)
// These 2 lines are only required if you're using mutex or block profiling
mutexRate
:=
GetEnvOrDefault
(
"PYROSCOPE_MUTEX_RATE"
,
5
)
// Read the explanation below for how to set these rates:
blockRate
:=
GetEnvOrDefault
(
"PYROSCOPE_BLOCK_RATE"
,
5
)
runtime
.
SetMutexProfileFraction
(
5
)
runtime
.
SetBlockProfileRate
(
5
)
runtime
.
SetMutexProfileFraction
(
mutexRate
)
runtime
.
SetBlockProfileRate
(
blockRate
)
_
,
err
:=
pyroscope
.
Start
(
pyroscope
.
Config
{
_
,
err
:=
pyroscope
.
Start
(
pyroscope
.
Config
{
ApplicationName
:
pyroscopeAppName
,
ApplicationName
:
pyroscopeAppName
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment