File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,20 @@ endif::[]
3030//===== Bug fixes
3131//
3232
33+ === Unreleased
34+
35+ // Unreleased changes go here
36+ // When the next release happens, nest these changes under the "Python Agent version 5.x" heading
37+ [float]
38+ ===== Features
39+
40+
41+ [float]
42+ ===== Bug fixes
43+
44+ * Updated CLOUD_PROVIDER config to allow for new options defined in https://github.com/elastic/apm/issues/289[#289] {pull}878[#878]
45+
46+
3347[[release-notes-5.x]]
3448=== Python Agent version 5.x
3549
Original file line number Diff line number Diff line change @@ -206,15 +206,15 @@ You must use the query bar to filter for a specific environment in versions prio
206206[options="header"]
207207|============
208208| Environment | Django/Flask | Default | Example
209- | `ELASTIC_APM_CLOUD_PROVIDER` | `CLOUD_PROVIDER` | `True ` | `"aws"`
209+ | `ELASTIC_APM_CLOUD_PROVIDER` | `CLOUD_PROVIDER` | `"auto" ` | `"aws"`
210210|============
211211
212212This config value allows you to specify which cloud provider should be assumed
213213for metadata collection. By default, the agent will attempt to detect the cloud
214214provider or, if that fails, will use trial and error to collect the metadata.
215215
216216Valid options are `"aws"`, `"gcp"`, and `"azure"`. If this config value is set
217- to `False `, then no cloud metadata will be collected.
217+ to `"none" `, then no cloud metadata will be collected.
218218
219219[float]
220220[[config-secret-token]]
Original file line number Diff line number Diff line change @@ -365,9 +365,9 @@ def get_cloud_info(self):
365365 Detects if the app is running in a cloud provider and fetches relevant
366366 metadata from the cloud provider's metadata endpoint.
367367 """
368- provider = self .config .cloud_provider
368+ provider = str ( self .config .cloud_provider ). lower ()
369369
370- if not provider :
370+ if not provider or provider == "none" or provider == "false" :
371371 return {}
372372 if provider == "aws" :
373373 data = cloud .aws_metadata ()
@@ -384,7 +384,7 @@ def get_cloud_info(self):
384384 if not data :
385385 self .logger .warning ("Cloud provider {0} defined, but no metadata was found." .format (provider ))
386386 return data
387- else :
387+ elif provider == "auto" or provider == "true" :
388388 # Trial and error
389389 data = {}
390390 data = cloud .aws_metadata ()
@@ -395,6 +395,9 @@ def get_cloud_info(self):
395395 return data
396396 data = cloud .azure_metadata ()
397397 return data
398+ else :
399+ self .logger .warning ("Unknown value for CLOUD_PROVIDER, skipping cloud metadata: {}" .format (provider ))
400+ return {}
398401
399402 def build_metadata (self ):
400403 data = {
You can’t perform that action at this time.
0 commit comments