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

bref-extra:newrelic-php-82 is not working #554

Open
kristijorgji opened this issue Sep 4, 2024 · 0 comments
Open

bref-extra:newrelic-php-82 is not working #554

kristijorgji opened this issue Sep 4, 2024 · 0 comments

Comments

@kristijorgji
Copy link

kristijorgji commented Sep 4, 2024

Hi all,

I am using serverless and your plugin bref-extra:newrelic-php-82
I have one Laravel 10.22.0 PHP application.

My issue is that no data is sent to newrelic. The lambda is working great

Example serverless.yaml file, (credentials and stuff are of course removed)

frameworkVersion: ^3.18.2

service: api

# allows loading .env and using them via $(env:variableName}
useDotenv: true

provider:
  name: aws
  region: eu-central-1
  stage: ${opt:stage, 'dev'}
  deploymentBucket:
    name: ${ssm:/${self:provider.stage}/${self:provider.region}/infra/serverless_deployment_bucket_name}
  tags:
    Environment: ${opt:stage, 'dev'}
    Project: ${self:custom.serviceName}
  environment:
    # our .env is loaded here via the plugin serverless-dotenv-plugin
    # required because we cannot write anywhere else within the AWS Lambda
    LARAVEL_STORAGE_PATH: /tmp/storage
    NEW_RELIC_LICENSE_KEY: "key"

custom:
  serviceName: 'api'

package:
  # Files and directories to exclude from deployment
  patterns:
    - '!node_modules/**'
    - '!public/storage'
    - '!resources/assets/**'
    - '!storage/**'
    - '!tests/**'
    - '!.env'
    - '!build/**'
    - '!dev-tools/**'
    - '!ext-config/**'
    - '!queries/**'

functions:
  # This function runs the Laravel website/API
  web:
    handler: public/index.php
    vpc:
      securityGroupIds:
        - ${ssm:/${self:provider.stage}/${self:provider.region}/applications/${self:custom.serviceName}/lambda_security_group}
      subnetIds: ${ssm:/${self:provider.stage}/${self:provider.region}/infra/vpc_private_subnets}
    runtime: php-82-fpm
    layers:
      - ${bref-extra:redis-php-82}
      - ${bref-extra:gd-php-82}
      - ${bref-extra:newrelic-php-82}
    environment:
      LOGGER_EMAIL_NAME: "[${env:APP_ENV}] API-api logger"
      NEW_RELIC_APP_NAME: "api-api-${env:APP_ENV}"
    events:
      - alb:
          listenerArn: ${ssm:/${self:provider.stage}/${self:provider.region}/infra/lb_https_listener_arn}
          multiValueHeaders: true
          priority: 1
          conditions:
            path:
              - /api/*

plugins:
  - ./vendor/bref/bref                        # lambda layer allowing laravel to work within aws serverless
  - ./vendor/bref/extra-php-extensions        # for enabling php extensions via bref
  - serverless-lift                           # provides aws functionalities for creating the sqs queue
  - serverless-dotenv-plugin                  # loads .env file into serverless variables

I checked

  1. The variables under lambda -> envrionment and they are really set
  2. The lambda layers in aws and I do see newrelic lambda layer there
Screenshot 2024-09-04 at 16 51 29

What can be the issue? I am lost on how to make this work

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

No branches or pull requests

1 participant