Docker-compose:在Openzipkin上公开Prometheus指标

时间:2018-07-26 08:54:53

标签: docker docker-compose prometheus zipkin

我正在使用docker-compose运行open-zipkin进行测试。最终目标是运行open-zipkin,以便我可以对zipkin容​​器本身成功进行curl localhost:9411/prometheus并查看Prometheus指标。我如何公开这样的指标?

作为参考,docker-compose文件的zipkin部分如下所示:

services:
storage:
image: openzipkin/zipkin-mysql
container_name: mysql
# Uncomment to expose the storage port for testing
# ports:
#   - 3306:3306

# The zipkin process services the UI, and also exposes a POST endpoint that
# instrumentation can send trace data to. Scribe is disabled by default.
zipkin:
image: openzipkin/zipkin
container_name: zipkin
# Environment settings are defined here https://github.com/openzipkin/zipkin/tree/1.19.0/zipkin-server#environment-variables
environment:
  - STORAGE_TYPE=mysql
  # Point the zipkin at the storage backend
  - MYSQL_HOST=mysql
  # Uncomment to enable scribe
  # - SCRIBE_ENABLED=true
  # Uncomment to enable self-tracing
  # - SELF_TRACING_ENABLED=true
  # Uncomment to enable debug logging
  # - JAVA_OPTS=-Dlogging.level.zipkin=DEBUG -Dlogging.level.zipkin2=DEBUG
ports:
  # Port used for the Zipkin UI and HTTP Api
  - 9411:9411
  # Uncomment if you set SCRIBE_ENABLED=true
  # - 9410:9410
depends_on:
  - storage

1 个答案:

答案 0 :(得分:0)

也许,我没有正确回答您的问题,但几乎包含您的Customer文件:

TfrmEncode = class(TForm)    
    pnlTop: TPanel;
    btnSaveToJSON: TButton;
    procedure FormCreate(Sender: TObject);
    procedure btnSaveToJSONMouseEnter(Sender: TObject);
    procedure btnSaveToJSONMouseLeave(Sender: TObject);
  private
    { Private declarations }
    pop : TPopup;
    cb : TColorBox;
    labelText: TLabel;
  public
    { Public declarations }
  end;

implementation

{$R *.fmx}

procedure TfrmEncode.btnSaveToJSONMouseEnter(Sender: TObject);
begin
  Pop.IsOpen := True;
end;

procedure TfrmEncode.btnSaveToJSONMouseLeave(Sender: TObject);
begin
  Pop.IsOpen := False;
end;

procedure TfrmEncode.FormCreate(Sender: TObject);
begin
  try
    pop := TPopup.Create(self);
    pop.Parent:= self;
    pop.Width:=200;

    cb := TColorBox.Create(pop);
    cb.Align := TAlignLayout.Client;
    cb.Color := TAlphaColors.White;
    pop.AddObject(cb);

    labelText := TLabel.Create(pop);
    labelText.Align  :=TAlignLayout.alClient;
    labelText.Parent := pop;
    labelText.Text := 'This is the hint This is the hint This is the hint This is the hint This is the hint This is the hint This is the hint This is the hint This is the hint This is the hint';
    pop.AddObject(labelText);

    pop.PlacementTarget := btnSaveToJSON;
    pop.Placement:=TPlacement.BottomCenter;
  finally
  end;

end;

procedure TfrmEncode.FormDestroy(Sender: TObject);
begin
  FreeAndNil(pop);
end;

docker-compose.yaml指标在容器内部和主机系统上的version: '3' services: storage: image: openzipkin/zipkin-mysql container_name: mysql zipkin: image: openzipkin/zipkin container_name: zipkin environment: - STORAGE_TYPE=mysql - MYSQL_HOST=mysql ports: - 9411:9411 depends_on: - storage 上均可用:

prometheus