Skip to content

Commit

Permalink
Configure Prometheus agent port based on trait property
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti authored and lburgazzoli committed Jan 24, 2019
1 parent fda6df9 commit b4f4e14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/trait/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.
package trait

import (
"strconv"

"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/util/envvar"

Expand Down Expand Up @@ -61,6 +63,9 @@ func (t *prometheusTrait) Configure(e *Environment) (bool, error) {
}

func (t *prometheusTrait) Apply(e *Environment) (err error) {
// Configure the Prometheus Java agent
envvar.SetVal(&e.EnvVars, "AB_PROMETHEUS_PORT", strconv.Itoa(t.Port))

// TODO: update the existing integration service instead of
// creating an extra service dedicated to Prometheus
svc := t.getServiceFor(e)
Expand Down

0 comments on commit b4f4e14

Please sign in to comment.