Skip to content

Commit

Permalink
Deprecate python-monitor monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Oct 11, 2024
1 parent b63ac24 commit 4e70e17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

- (Splunk) Deprecate cloudfoundry monitor ([#5495](https://github.com/signalfx/splunk-otel-collector/pull/5495))
- (Splunk) Deprecate the heroku observer. Use the [resource detection observer with heroku detector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#heroku) instead. ([#5496](https://github.com/signalfx/splunk-otel-collector/pull/5496))

- (Splunk) Deprecate python-monitor monitor ([#5501](https://github.com/signalfx/splunk-otel-collector/pull/5501))
## v0.111.0


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
monitors:
- monitorType: python-monitor
doc: |
**This monitor is deprecated and will be removed soon.**
This monitor allows you to generate metrics from a Python script.
Your Python code should be Python 2.7+ *AND* 3.0+ compatible. The Python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ package python

import (
"encoding/json"
"github.com/signalfx/signalfx-agent/pkg/utils"
log "github.com/sirupsen/logrus"
"os"
"strings"
"time"

"github.com/signalfx/signalfx-agent/pkg/core/config"
"github.com/signalfx/signalfx-agent/pkg/monitors"
Expand Down Expand Up @@ -88,6 +91,8 @@ type PyMonitor struct {
// Configure starts the subprocess and configures the plugin
func (m *PyMonitor) Configure(conf *Config) error {
runtimeConf := subproc.DefaultPythonRuntimeConfig(conf.BundleDir, "sfxmonitor")
logger := utils.NewThrottledLogger(log.WithFields(log.Fields{"monitorType": monitorType, "monitorID": conf.MonitorID}), 30*time.Second)
logger.Warn("python-monitor is deprecated and will be removed soon.")
if conf.PythonBinary != "" {
runtimeConf.Binary = conf.PythonBinary
runtimeConf.Env = os.Environ()
Expand Down

0 comments on commit 4e70e17

Please sign in to comment.