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

Add x-ray enable flag to API gateway #581

Closed
mburket opened this issue Sep 13, 2018 · 11 comments · Fixed by #657
Closed

Add x-ray enable flag to API gateway #581

mburket opened this issue Sep 13, 2018 · 11 comments · Fixed by #657

Comments

@mburket
Copy link

mburket commented Sep 13, 2018

Description:

Hi, a recent announcement of x-ray support for API gateway --https://aws.amazon.com/blogs/aws/apigateway-xray/

Will that be added to SAM soon?

@Tanbouz
Copy link
Contributor

Tanbouz commented Oct 19, 2018

I was trying to enable it through SAM too.

The unfortunate part is that even in CloudFormation AWS::ApiGateway::Stage I couldn't find any config to enable it.

Also in the docs, no CloudFormation.

Enabling X-Ray tracing in the API Gateway console
Enabling AWS X-Ray tracing in the API Gateway CLI
Enabling AWS X-Ray tracing using the API Gateway REST API

The good part is that once it is enabled in console, it won't change when you redeploy the SAM template (at least for now).

@nzoschke
Copy link
Contributor

As a temporary workaround, I built a custom resource to toggle the setting:

  ApiGatewayStage:
    Properties:
      RestApiId: !Ref ServerlessRestApi
      ServiceToken: !GetAtt CustomResourceFunction.Arn
      Stage: !Ref ServerlessRestApiProdStage
      TracingEnabled: true
    Type: Custom::ApiGatewayStage

From https://github.com/nzoschke/gofaas/blob/master/template.yml#L197-L203

With the Lambda implementation handler here:

https://github.com/nzoschke/gofaas/blob/master/cfresource.go

@brettstack
Copy link
Contributor

This would be a great first PR if anyone wanted to give it a shot.

@terodox
Copy link

terodox commented Dec 18, 2018

Any idea when this will be released? I'm hoping to avoid a post deployment script if possible.

Thanks!

@jlhood
Copy link
Contributor

jlhood commented Dec 18, 2018

@terodox Thanks for asking. We're not able to share internal dates so the best I can say is "soon".

@alanwill
Copy link

Weird, the spec mentions TracingEnabled is included in AWS::Serverless::Api however it fails when deploying:

UPDATE_FAILED

Embedded stack arn:aws:cloudformation:us-east-1:xxxxxx:stack/xxxxxx was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [apigatewaySlack] is invalid. property TracingEnabled not defined for resource of type AWS::Serverless::Api

And the CFN reference is:

    apigatewaySlack:
        Type: AWS::Serverless::Api
        Properties:
            StageName: !Ref stage
            DefinitionUri: ../../sam/api/swagger.yaml
            TracingEnabled: true
            AccessLogSetting:
                DestinationArn: cwlaccesslogs.Arn
            MethodSettings: 
                DataTraceEnabled: true
                HttpMethod: '*'
                LoggingLevel: INFO
                MetricsEnabled: true
                ResourcePath: /

@Dunedan
Copy link
Contributor

Dunedan commented Dec 24, 2018

@alanwill The spec in the master branch doesn't mention TracingEnabled. It got merged into the develop branch so far, but hasn't been released yet. Therefore it's not available for use yet.

@jameszh
Copy link

jameszh commented Jan 31, 2019

ETA for the release ? I still got "property TracingEnabled not defined for resource of type AWS::Serverless::Api"

@brettstack
Copy link
Contributor

Unfortunately we can't comment on any specific date, but we are actively working towards a release - this is a top priority for our team.

@gitorrin
Copy link

I'm also looking forward to this release..

@keetonian
Copy link
Contributor

Released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.