hello! i’m currently running into an issue when ru...
# community-support
s
hello! i’m currently running into an issue when running
edr monitor
through GHA. im getting the message “Update skipped alerts” and no alerts are being sent out, after checking all of the
alerts_*
tables, they are coming up blank.
elementary_test_results
table has results, however. any ideas why these tables arent populating?
i
Hey @Savannah Stelling, thank you for reaching out! Update skipped alerts is a step that elementary is doing even if there are no alerts to skip (the step is doing nothing in that case), so it is fine in your case 🙂 I have some questions to try and understand better the issue: 1. Which version of elementary are you using? 2. Are your results in elementary_test_results from the last 24 hours? Last 7 days? 3. Is any of those results is a failure? 4. Is alerts_v2 is also empty? 5. Do you have data in your dbt_tests table? Thanks!
s
hi @Idan Shavit! 1. we are using elementary-data 0.13.0 2.
elementary_test_results
is only showing results from the most recent run last night (we have it running when we refresh dbt nightly) 3. yes, there are failures present 4. i dont see an
alerts_v2
table, the below screenshot shows the alerts tables we have populating 5. yes, there is data in
dbt_tests
, similarly to
elementary_test_results
it only shows data from the most recent nightly run
i
Thanks for the info! Because you are using elementary 0.13.0 you don't have alerts_v2 (and that is fine 🙂). Care to share with me the steps of your GHA? If you see elementary_test_results, running now edr monitor should populate your alerts tables. Because this is not happening I need to have a bit more information about how you run things 🙂
s
sure - here’s our workflow file. we tried using the run-elementary-action you reference in the docs but we were having problems with package dependencies etc. so we broke it out like so:
Copy code
name: Run Elementary
on:

  # Run the action in a scheduled manner every hour.
  schedule:
    - cron: '0 11 * * *'

  # Allows you to run this workflow manually from the Actions tab.
  workflow_dispatch:

jobs:
  elementary:
    runs-on: [self-hosted, Linux, x64, fargate, prod]
    env:
      PROFILES_YML_HOST_PROD_SERVERLESS: ${{ secrets.PROFILES_YML_HOST_PROD_SERVERLESS }}
      PROFILES_YML_USER_PROD: ${{ secrets.PROFILES_YML_USER_PROD }}
      PROFILES_YML_PW_PROD: ${{ secrets.PROFILES_YML_PW_PROD }}
      ELEMENTARY_SLACK_TOKEN: ${{ secrets.ELEMENTARY_SLACK_TOKEN }}
      ELEMENTARY_SLACK_CHANNEL: ${{ secrets.ELEMENTARY_SLACK_CHANNEL }}
      ELEMENTARY_REPORT_BUCKET: ${{ secrets.ELEMENTARY_REPORT_BUCKET }}

    steps:
      - name: Checkout dbt project
        uses: actions/checkout@v3
      
      - name: Install Python
        uses: actions/setup-python@v3
        with:
          python-version: '3.9'

      - name: Install Elementary
        run: pip install 'elementary-data[redshift]'

      - name: Run Elementary
        shell: bash -l {0}
        run: |
          edr monitor --profiles-dir /actions-runner/_work/${{ github.event.repository.name }}/${{github.event.repository.name }}/ci_cd/prod_dbt --slack-token $ELEMENTARY_SLACK_TOKEN --slack-channel-name $ELEMENTARY_SLACK_CHANNEL
          edr send-report --env prod --profiles-dir /actions-runner/_work/${{ github.event.repository.name }}/${{github.event.repository.name }}/ci_cd/prod_dbt --s3-bucket-name $ELEMENTARY_REPORT_BUCKET --update-bucket-website "true"

      - name: Upload report
        uses: actions/upload-artifact@v3
        with:
          name: elementary_report.html
          path: elementary_report.html

      - name: Upload log
        if: always()
        uses: actions/upload-artifact@v3
        with:
          name: edr.log
          path: edr.log
@Idan Shavit update here - i do actually see in the logs a reference to the table alerts_v2. i checked our data warehouse and it looks like this table is being generated in a different schema (normal schema with other data is
dw_elementary
, but alerts_v2 is going to
dw
). the table is still empty in that location as well
i
Thanks for all the info @Savannah Stelling! There are 2 issues that I can think of in your case: 1. You don't limit the version of elementary-data python package to match the version of your elementary dbt package. We make sure that there is compatibility only between version with the same minor version like 0.13.X. In your case you are using 0.13.0 in your dbt package, but here you install 0.14.1 (you don't limit the version) for the python package. 2. Because the normal schema you are writing to is
dw_elementary
and the schema that
alerts_v2
is writing to is
dw
I think that you need to tweak the elementary profile to use the schema
dw_elementary
- on our dbt package we add the
_elementary
suffix to the schema, but for the edr we need to specify the schema it should look for the data at, which in your case is
dw_elementary
. So the elementary profile should have the schema
dw_elementary
- This is probably why your tables are empty 🙂
And in order to improve, can you elaborate on the issues you were having with our GHA?
y
just to chime in, I had the same issue and was able to fix it by running
dbt run -s elementary
. I previously had different versions for edr and dbt package and had since fixed the version gap, but I probably forgot to run this command.
s
@Yaoni thats how i fixed it as well!
❤️ 1