Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate python-monitor monitor #5501

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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 @@ -7,12 +7,16 @@ import (
"encoding/json"
"os"
"strings"
"time"

log "github.com/sirupsen/logrus"

"github.com/signalfx/signalfx-agent/pkg/core/config"
"github.com/signalfx/signalfx-agent/pkg/monitors"
"github.com/signalfx/signalfx-agent/pkg/monitors/subproc"
"github.com/signalfx/signalfx-agent/pkg/monitors/subproc/signalfx"
"github.com/signalfx/signalfx-agent/pkg/monitors/types"
"github.com/signalfx/signalfx-agent/pkg/utils"
)

func init() {
Expand Down Expand Up @@ -88,6 +92,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
Loading