小编Hir*_*uda的帖子

无法通过 Amazon ECS、Fargate 中的 datadog 发送“标签”

我已在 Amazon ECS、Fargate 上配置了 datadog 代理。我可以发送所有预期的指标,但无法发送“标签”。

我已在 ECS 任务定义中设置环境变量。

DD_API_KEY  xxxxxxxxxxxxxxxxxxxxxxx
DD_TAGS     env:stg
ECS_FARGATE true
Run Code Online (Sandbox Code Playgroud)

我认为大部分设置都没有问题,因为我可以看到我想要看到的指标。但是 datadog UI 中缺少标签,尤其是 env:stg,并且由于这个奇怪的错误,缺少一些指标。

有谁知道这个错误的原因以及解决这个问题的方法?

谢谢。

amazon-ecs datadog aws-fargate

2
推荐指数
1
解决办法
985
查看次数

如何通过Grape API获取路线

我用宝石,葡萄做api.我试图通过命令得到api urlsrake grape:routes

    namespace :grape do
      desc "routes"
      task :routes => :environment do
        API::Root.routes.map { |route| puts "#{route} \n" }
      end
    end
Run Code Online (Sandbox Code Playgroud)

但是我过了 rake grape:routes

    #<Grape::Router::Route:0x007f9040d13878>
    #<Grape::Router::Route:0x007f9040d13878>
    #<Grape::Router::Route:0x007f9040d13878>
    #<Grape::Router::Route:0x007f9040d13878>
    ...
Run Code Online (Sandbox Code Playgroud)

我想要这样的东西.

    version=v1, method=GET, path=/services(.:format)
    version=v1, method=GET, path=/services/:id(.:format)
    ...
Run Code Online (Sandbox Code Playgroud)

我的葡萄实施如下.这很好用.

    module API
      class Root < Grape::API
        version 'v1', using: :path
        format :json

        helpers Devise::Controllers::Helpers

        mount API::Admin::Services
      end
    end



    module API
      class Services < Grape::API
        resources :services do
          resource ':service_id' do
            ...
          end
        end
      end
    end
Run Code Online (Sandbox Code Playgroud)

api ruby-on-rails ruby-grape

1
推荐指数
1
解决办法
4386
查看次数