Skip to content

Commit

Permalink
remove old api key format from example docs (#2619)
Browse files Browse the repository at this point in the history
* remove old api keys from examples

* Update rust example
  • Loading branch information
Rperry2174 committed Dec 11, 2023
1 parent 30f69c4 commit 2a6e094
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion docs/sources/configure-client/language-sdks/java.md
Expand Up @@ -76,7 +76,8 @@ public void init() {
.setFormat(Format.JFR)
.setServerAddress("http://pyroscope-server:4040")
// Optionally, if authentication is enabled, specify the API key.
// .setAuthToken(System.getenv("PYROSCOPE_AUTH_TOKEN"))
// .setBasicAuthUser("<User>")
// .setBasicAuthPassword("<Password>")
// Optionally, if you'd like to set allocation threshold to register events, in bytes. '0' registers all events
// .setProfilingAlloc("0")
.build()
Expand Down
1 change: 0 additions & 1 deletion examples/golang-push/rideshare/rideshare/rideshare.go
Expand Up @@ -79,7 +79,6 @@ func ReadConfig() Config {
c := Config{
AppName: os.Getenv("PYROSCOPE_APPLICATION_NAME"),
PyroscopeServerAddress: os.Getenv("PYROSCOPE_SERVER_ADDRESS"),
PyroscopeAuthToken: os.Getenv("PYROSCOPE_AUTH_TOKEN"),
PyroscopeBasicAuthUser: os.Getenv("PYROSCOPE_BASIC_AUTH_USER"),
PyroscopeBasicAuthPassword: os.Getenv("PYROSCOPE_BASIC_AUTH_PASSWORD"),

Expand Down
6 changes: 4 additions & 2 deletions examples/python/rideshare/django/app/hello_django/settings.py
Expand Up @@ -140,12 +140,14 @@

app_name = os.getenv("PYROSCOPE_APPLICATION_NAME", "django-ride-sharing-app")
server_addr = os.getenv("PYROSCOPE_SERVER_ADDRESS", "http://pyroscope:4040")
auth_token = os.getenv("PYROSCOPE_AUTH_TOKEN", "")
basic_auth_username = os.getenv("PYROSCOPE_BASIC_AUTH_USER", "")
basic_auth_password = os.getenv("PYROSCOPE_BASIC_AUTH_PASSWORD", "")

pyroscope.configure(
application_name = app_name,
server_address = server_addr,
auth_token = auth_token,
basic_auth_username = basic_auth_username,
basic_auth_password = basic_auth_password,
# tags = {
# "region": f'{os.getenv("REGION")}',
# }
Expand Down
6 changes: 2 additions & 4 deletions examples/python/rideshare/flask/lib/server.py
Expand Up @@ -8,16 +8,14 @@

app_name = os.getenv("PYROSCOPE_APPLICATION_NAME", "flask-ride-sharing-app")
server_addr = os.getenv("PYROSCOPE_SERVER_ADDRESS", "http://pyroscope:4040")
auth_token = os.getenv("PYROSCOPE_AUTH_TOKEN", "")
basic_auth_username = os.getenv("PYROSCOPE_BASIC_AUTH_USER", "")
basic_auth_password = os.getenv("PYROSCOPE_BASIC_AUTH_PASSWORD", "")

pyroscope.configure(
application_name = app_name,
server_address = server_addr,
auth_token = auth_token, # for og pyroscope or cloudstorage
basic_auth_username = basic_auth_username, # for grafana cloud
basic_auth_password = basic_auth_password, # for grafana cloud
basic_auth_username = basic_auth_username, # for grafana cloud
basic_auth_password = basic_auth_password, # for grafana cloud
tags = {
"region": f'{os.getenv("REGION")}',
}
Expand Down
Expand Up @@ -7,8 +7,6 @@
Pyroscope.configure do |config|
config.app_name = app_name
config.server_address = pyroscope_server_address
config.auth_token = ENV.fetch("PYROSCOPE_AUTH_TOKEN", "")
config.auth_token = ENV.fetch("PYROSCOPE_AUTH_TOKEN", "")
config.basic_auth_username = ENV.fetch("PYROSCOPE_BASIC_AUTH_USER", "")
config.basic_auth_password = ENV.fetch("PYROSCOPE_BASIC_AUTH_PASSWORD", "")

Expand Down
7 changes: 5 additions & 2 deletions examples/rust/rideshare/server/src/main.rs
Expand Up @@ -30,12 +30,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let app_name = std::env::var("PYROSCOPE_APPLICATION_NAME")
.unwrap_or_else(|_| "rust-ride-sharing-app".to_string());

let auth_token = std::env::var("PYROSCOPE_AUTH_TOKEN")
let auth_user = std::env::var("PYROSCOPE_BASIC_AUTH_USER")
.unwrap_or_else(|_| "".to_string());

let auth_password = std::env::var("PYROSCOPE_BASIC_AUTH_PASSWORD")
.unwrap_or_else(|_| "".to_string());

// Configure Pyroscope client.
let agent = PyroscopeAgent::builder(server_address, app_name.to_owned())
.auth_token(auth_token)
.basic_auth(auth_user, auth_password)
.backend(pprof_backend(PprofConfig::new().sample_rate(100)))
.tags(vec![("region", &region)])
.build()
Expand Down

0 comments on commit 2a6e094

Please sign in to comment.