forked from DataDog/datadog-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathembed_python.go
More file actions
30 lines (25 loc) · 920 Bytes
/
embed_python.go
File metadata and controls
30 lines (25 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
//go:build python
// +build python
package collector
import (
"github.com/DataDog/datadog-agent/pkg/collector/python"
"github.com/DataDog/datadog-agent/pkg/config"
"github.com/DataDog/datadog-agent/pkg/util/log"
)
func pySetup(paths ...string) (pythonVersion, pythonHome, pythonPath string) {
if err := python.Initialize(paths...); err != nil {
log.Errorf("Could not initialize Python: %s", err)
}
return python.PythonVersion, python.PythonHome, python.PythonPath
}
func pyPrepareEnv() error {
if config.Datadog.IsSet("procfs_path") {
procfsPath := config.Datadog.GetString("procfs_path")
return python.SetPythonPsutilProcPath(procfsPath)
}
return nil
}